Question: // Lab 4B Gradebook BEGIN // Chapter 4 Decisions, Nested If Structures // 1. Run this BEGIN file. Examine the code and analyze it. Run

 // Lab 4B Gradebook BEGIN // Chapter 4 Decisions, Nested If
Structures // 1. Run this BEGIN file. Examine the code and analyze
it. Run the program // multiple times so that each branch is

// Lab 4B Gradebook BEGIN // Chapter 4 Decisions, Nested If Structures // 1. Run this BEGIN file. Examine the code and analyze it. Run the program // multiple times so that each branch is tested and verified. This code works Il for an A student or a B student. It is not yet finished for a C, D, or F student. // Review every line of code. il Once you fully understand the code add the following modifications || 2. Complete the code for a grade of C, D or F. Il Include appropriate comments for a C grade, D grade and an F grade. // 3. Modify the logic so that if a student earns a D or F in the course, instead of displaying // the sentence "Please see a counselor." instead display a sentence stating "You must // retake the course before registering for advanced courses." // Test all branches to ensure the program works correctly (Test for an A, B, C, D and F student) // Submit the .cpp file // Your Name || CIS-5 Online or Hybrid // Date // Assignment #include #include #include using namespace std; int main() string name; int test1, test2, test3; int numTests = 3; float avg; char answer, grade; bool isActive; CAD on. grade: bool isActive; const float A_GRADE = 90.00; const float B_GRADE = 80.00; const float C_GRADE = 70.00; const float D_GRADE = 60.00 cout > answer; if (answer == 'Y' || answer == 'y') isActive = true; else if (answer == 'N' || answer == 'n') isActive = false; else { cout > test1 >> test2 >> test3; // user may input integers only, assume user inputs valid data avg = static_castcfloat>(test1 + test2 + test3)/ numTests; // cast to a float for decimal cout = A_GRADE) && (isActive == true)) { grade = 'A'; cout = B_GRADE) && (isActive == true)) { grade = 'B'; cout > test1 >> test2 >> test3; // user may input integers only, assume user inputs valid data avg = static_cast float>(test1 + test2 + test3) / numTests; // cast to a float for decimal cout = A_GRADE) && (isActive == true)) { grade = 'A'; cout = B_GRADE) && (isActive == true)) { grade = 'B'; cout

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!