Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Filename: cs201hw2b.cpp Using this program as a guide http://students.cmps.subr.

ID: 3558854 • Letter: F

Question

Filename: cs201hw2b.cpp Using this program as a guide http://students.cmps.subr.edu/cs190/class_examples/ex-structure.cpp Write a program that creates a structure that will store a student's name, ID number, age, and 3 test scores. Each line will contain a students id, age and 3 test scores. Print out the students id, age, 3 test scores and total number of points. Your program should work for any number of lines of data. Example Data File Smith 124 25 100 90 80 Jones 400 18 90 80 70 Gray 455 20 60 77 71

Explanation / Answer

#include <iostream>
#include <string>
using namespace std;
struct student_info
{
string name;
int ID;
int age;
int test[3];
};
student_info student;
main()
{
   while (cin>>student.name>>student.ID>>student.age >> student.test[0] >> student.test[1] >> student.test[2])
   {
      cout <<student.ID << " " << student.age << " " <<student.test[0] <<" " << student.test[1] << " " <<student.test[2] << " " <<
      (student.test[0] + student.test[1] + student.test[2]) << endl;
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote