Create a C++ console project in Visual Studio or another tool. Create an application that converts a student’s grade percentage to a letter grade following the rules below: Grade Percentage A 100-90 B 89-80 C 79-70 D 69-60 F 59-0 Your code should prompt for and get the student’s percentage as input, and output an error message or a letter grade. Note: Your code should test these cases: Percentages less than 0 – error message. Percentages greater than 100 – error message. Percentages in the range 0-100 – letter grade. Please make sure your code can handle these cases. Tips: Use operator and ‘||’ for the conditional control statement. Use instruction ‘if’ for conditional control. Make the following edits to the code file: Complete the header comment. 2) Declare two double variables: grade and percentage. 3) Assign the value of percentage from input. 4) End program if percentage is smaller than 0 and larger than 100. 5) Convert percentage to grade. 6) Print the grade.
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Create a C++ console project in Visual Studio or another tool. Create an application that converts a student’s grade percentage to a letter grade following the rules below:
Grade |
Percentage |
A |
100-90 |
B |
89-80 |
C |
79-70 |
D |
69-60 |
F |
59-0 |
Your code should prompt for and get the student’s percentage as input, and output an error message or a letter grade.
Note: Your code should test these cases:
- Percentages less than 0 – error message.
- Percentages greater than 100 – error message.
- Percentages in the range 0-100 – letter grade.
Please make sure your code can handle these cases.
Tips: Use operator and ‘||’ for the conditional control statement. Use instruction ‘if’ for conditional control.
Make the following edits to the code file:
- Complete the header comment.
2) Declare two double variables: grade and percentage.
3) Assign the value of percentage from input.
4) End program if percentage is smaller than 0 and larger than 100.
5) Convert percentage to grade.
6) Print the grade.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images