Question: A . Write a c + + program that will do the following: Ask the user for their hypothetical final accumulated grade in this course

A. Write a c++ program that will do the following:
Ask the user for their hypothetical final accumulated grade in this course as an integer variable.
Use nested if...else statements to match their accumulated grade with correct letter grade. The
pseudocode will look like:
Prompt user to enter their final accumulated grade,
If students grade is greater than or equal to 90,
Print A.
Else
If students grade is greater than or equal to 80,
Print B
Else
If students grade is greater than or equal to 70,
Print C
Else
If students grade is greater than or equal to 60,
Print D
Else
Print F
You should try 5 different total grades to test each if statement.
Now use while statement with counter-controlled structure to perform the following addition to your
program:
Define total, grade counter and grades as integer, and average as double
Set total grades to zero
Set grade counter to one or zero
While grade counter is less than or equal to 7,
Prompt the user to enter the next grade,
Input the next grade and echo the grade and its equivalent Letter grade separated by
tab escape sequence (\t) back to user, the output should look like
[Enter grade: 88
Your grade is: 88 and your letter grade is: B]
Add the grade into the total
Add one to the grade counter
Set the class average to the total divided by 7,[by using the unary cast operator to obtain
fractional results from the division of two integers, or use very simple approach of
manipulation of integers with floats/doubles;
average= static_cast(total)/grade counter
Print the total of the grades for all 7 students
Print the class average with two decimal places
The sample output may look like:
Enter your grade: 99
Your grade is: 99 and your letter grade is: A
Enter your grade: 100
Your grade is: 99 and your letter grade is: A
Enter your grade: 88
Your grade is: 88 and your letter grade is: B
Enter your grade: 77
Your grade is: 77 and your letter grade is: C
Enter your grade: 66
Your grade is: 66 and your letter grade is: D
Enter your grade: 55
Your grade is: 55 and your letter grade is: F
Enter your grade: 89
Your grade is: 89 and your letter grade is: B
Class Average is 82.00
Class Total is 574
B. Write a program that reads a nonnegative integer and computes and prints its factorial. The factorial of a
nonnegative integer n is written n!(pronounced n factorial) and is defined as follows:
n!= n(n1)(n2)...1(for values of n greater than 1)
and
n!=1(for n=0 or n=1).

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!