C ++ Using the following code: 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_cast(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?
C ++
Using the following code:
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_cast<GradeLevels>(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?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps