Question: Question asks this: Assume the declarations of Exercise 2. Write C++ statements that do the following: Store the following information in course: name: Programming I

Question asks this: Assume the declarations of Exercise 2. Write C++ statements that do the following:

Store the following information in course: name: Programming I callNum: 13452 credits: 3 grade: ""

In the array classList, initialize each gpa to 0.0.

Copy the information of the thirty-first component of the array classList into student.

Update the gpa of the tenth student in the array classList by adding 0.75 to its previous value.

The Excercise 2 structs are this:

struct nameType struct courseType struct studentType { { { string first; string name; string last; int callNum; nameType name; }; int callNum; double gpa; int credits; courseType course; char grade; }; };

The program I wrote is this:

//Taylor Wyss

//11/21/2017

//CSC160C11

#include

#include

using namespace std;

struct nameType

{

string first;

string last;

};

struct courseType

{

string name;

int callNum;

int credits;

char grade;

};

struct studentType

{

nameType name;

double gpa;

courseType course;

}

int main()

{

struct studentType student;

struct studentType classList[100];

struct courseType course;

struct nameType name;

course.name = 'Programming 1';

course.callNum = 13452;

course.credits = 3;

course.grade = '';

for (int i = 0; i

{

classList[i].gpa = 0.0;

}

student = classList[30];

classList[9].gpa += .75;

system("pause");

return 0;

};

However I get these errors when I try to run it:

Question asks this: Assume the declarations of Exercise 2. Write C++ statements

Y - Cuick Launch (Cen-0) P - x Taylor Wyss - Tw Mod 1 Program Microsoft Visual Studio Express 2015 for Windows Desktop FileEdit View Project Build Debug Team Tools Test Window Hcip 0-0 329 2 --Decug - x36 -> Local Windows Debugger - P, EE| == |A 11 = a Source.cpp px Mod Program (Glotzal Scope) 4x =int main() strucl studenlType studeril; Struct studentType classList[1981; struct courseType coursc; struct namelype name; Solution Explorer O O A 5 d A > - Search Sclistican Fxplorer (Ctrl+;) Solution ModiProgram" (1 premjert) - 3 Mod Program DE References GExternal Dependencies - Header Files al Resource Files - A Source files Source.pe course.name - Programming 1'; Course.ca11 Num - 13457; course.credits = 3; course.grade - ; | for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!