Question: C++: Consider the following code segment: enum GradeLevel { FRESHMAN , SOPHMORE , JUNIOR , SENIOR }; struct Student { string first ; string middle

C++: Consider the following code segment:

enum GradeLevel { FRESHMAN, SOPHMORE, JUNIOR, SENIOR };

struct Student

{

string first;

string middle;

string last;

GradeLevel year;

float GPA;

};

Student A0012; // Student ID A0012

Student A0013; // Student ID A0013

A0012.first = "Bjarne";

A0012.last = "Stroustrup";

A0012.GPA = 3.56;

A0013 = A0012;

A0012.year = SENIOR;

A0013.middle = "C++";

A0013.year = static_castGradeLevels>(A0012.year - 2);

A0013.GPA = floor(A0012.GPA); // floor() rounds down to whole number

A0012.middle = A0013.middle.at(0) + ".";

What are the contents of the Student variables after this code has executed? Use the chart provided. Who is Bjarne Stroustrup anyway (Google it)?

Field

A0012

A0013

string first

string middle

string last

GradeLevel year

float GPA

 C++: Consider the following code segment: enum GradeLevel { FRESHMAN, SOPHMORE,

10. (8 Points) Consider the following code segment: enum GradeLevel \{ FRESHMAN, SOPHMORE, JUNIOR, SENIOR \}; struct Student \{ string first; string middle; string last; GradeLevel year; float GPA; \}; Student A0012; // Student ID A0012 Student A0013; // Student ID A0013 A0012.first = "Bjarne" A0012.last = "Stroustrup"; A0013=A0012; AO012, year = SENIOR; A0013. middle =nC++; A0013. year = static_cast>( A0012. year 2); A0013.GPA = floor (A0012.GPA); // floor () rounds down to whole number A0012 middle = A0013.middle at (0)+nn; What are the contents of the Student variables after this code has executed? Use the chart provided. Who is Bjarne Stroustrup anyway (Google it)

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!