Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ please Write a program that uses a stuct named student to store information about a Student. You will be reading from a text

image text in transcribed
image text in transcribed
image text in transcribed
in c++ please
Write a program that uses a stuct named student to store information about a Student. You will be reading from a text input file into an array (size 20) of Student structs. The program will contan the following filest main. epp contains the main function for testing the proykan. Student.h and Student. epp represent a clasoroom gtudent scruet, which has three dater membera: firat name, last name, and GPA. Z2udents tog - Text file with student information (1) Buld the student struct wth the following specifcotions in the fies (student.h and student. cpp): char tirntName [101] char 1artkamel101] dowble gpaz You may Not use strings (2) Create the following functions (student, h and student, . cpp) of students in the array - yo d pronvalues (Studert studentustli int numstudents) 7 prints the contents of the orray call the printvalues() function to priat out the list of students. (4) Program input and outbut Fle input students,txt Henry:Nguyenit3 is Brendersterni2.0 Lyndarabisonis:2 Senysiring:3.9 Use the setud () and Meft manipulators to create colurns for printing - 15 characters for Student First Name and 15 characters for Student first Name, and 3 characters for GPA. (5) Notes: - Add the struct definition before the function prototypest Check oot Struatsind Array Exariole Section 164 - Make sure to have Ainclude ciomanips in your Studentcpp fle. - Make sure to have the staternent cout ex fixed se chowpoint ss setprecison(1), in your printvaluesif function. - Make sure the prompts and the output look the sarre as the above evarnples. - Use infle getine(varName, 101) to read students nomes. - Have a newine (endi) at the end of every promot to match the outpot Cument file: main.cpp + Load default teenplate. 1 anclude slostreass ainclude kcstring? Einciude ifstrean anciude "student.h" using nanespace std. int maln() (d) 1e. Student studentcist(50)]. 11 Int nunstudents : ay 12 Ifstrean infile; 13 14. 1 " edd your code there % 15 16. return e: 1717 Runyour program as often as youd like, before submiting for grading. Below, pye any necded input values in the fist box, then cl ck Run program and observe the programis output in the second box

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions