Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Language is C++. The variables from part 4A are a variable that is a float called var19 and another float called var20. An overall
The Language is C++. The variables from part 4A are a variable that is a float called var19 and another float called var20. An overall percentage is calculated into var21 (representing the sum of the total points earned divided by the total points possible) and is output as a percentage. The values 45.77 and 66.54 are placed into each of the two variables (using literals). Please do all parts of the problem.
5) Decisions 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". 5) Decisions 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 falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started