Question: A. Using the variables from part 4A and the code that calculates an overall percentage (sum of the total points earned divided by the total

A. Using the variables from part 4A and the code that calculates an overall percentage (sum of the total points earned divided by the total points possible), and then output the percentage, determine the letter grade from that percentage (var21) by using the following scale: a. A: 93%-100% ; A-: 90%-92.99% ; B+: 87%-89.99% ; B: 83%-86.99%; B-: 80%-82.99%; C+: 77%-79.99%; C: 73%-76.99%; C-: 70%-72.99%; D+: 67%-69.99%; D: 63%-66.99%; D-: 60%-62.99%; F: Less than 60%. b. Print out the letter grade is followed by the correct letter grade value.

B. Create a bool variable called var27. Test to see whether the variable is on or off, that is, whether the var27 variable is true or false (you can assign it to either). If it is true then display the strategy calls for the university to buy more ice cream, otherwise, display the strategy saves expenditures for the university.

C. Create a decision structure that (in the expression), compares the result of a computation (such as 5 + 7) to that of the value of a variable (var28 that you will create and initialize for this). Display whichever was greater than the other.

D. Create var29 as a short int and set it to 199, and var30 as a bool and set it to true. Next write a test based on compound (multiple) conditions. We got information that var30 almost always determines the outcome (80% of the time). With that in mind, write the test as an if-else: if var30 is true and var29 is greater than 150, then the entire test is true, otherwise if either one of them is not then the entire test is false. Make sure you leverage short-circuiting. Display the test is true or the test is false.

4A:

float var19,var20,var21,sum;

cout << "enter the two numbers " << endl; cin>> var19 >> var20; sum = var19 + var20; var21= (sum/200) *100 ; //200 is taken as total cout << "The sum of " << var19 << " and " << var20 << " is " << sum << "." << endl; cout << "The percentage of " << var19 << " and " << var20 << " is " << var21 << "%." << endl;

c++ language

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!