Question: Consider the following C + + code: / / This C + + program prints You Pass if a student's average is / / 6

Consider the following C++ code:
// This C++ program prints "You Pass" if a student's average is
//60 or higher and prints "You Fail" otherwise
#include
using namespace std;
int main()
{
float average; // holds the grade average
cout "Input your average:" endl;
cin >> average;
if (average >60)
cout "You Pass" endl;
if (average 60)
cout "You Fail" endl;
return 0;
}
Exercise 1: Use if-else-if statement to modify the C++ program above to allow the following categories: Invalid data (data above 100),A category (90100),B category (8089),You Pass category (6079),You Fail category (059). Save the C++ program as Lab3_p3a.cpp
Part 2: Use nested if statements to rewrite your C++ program in exercise 1. Save the program as Lab3_p3b.cpp
Part 3: Use logical operators to connect more than one relational expression to rewrite your C++ program in exercise 1. Save the C++ program as Lab3_p3c.cpp
Consider the following code:
// This program prints "You Pass" if a student's average is
//60 or higher and prints "You Fail" otherwise
#include
using namespace std;
int main()
l
float average; // holds the grade average
cout "Input your average:" endl;
cin \gg average;
if (average >60)
cout "You Pass" endl;
if (average 60)
cout "You Fail" endl;
return 0;
)
Exercise 1: Use if-else-if statement to modify the program above to allow the following categories:
Invalid data (data above 100),'A' category (90-100),'B' category (80-89), "You Pass" category (60-79),
"You Fail" category (0-59).
Save the program as Lab3_p3a.cpp
Use nested if statements to rewrite your program in exercise 1.
Save the program as Lab3_p3b.cpp
Use logical operators to connect more than one relational expression to rewrite your program in
exercise 1.
Save the C++ program as Lab3_p3c.cpp
Submit all programs to Brightspace under Lab Assignment 3.
Consider the following C + + code: / / This C + +

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 Programming Questions!