You are working on problem set: PS4 (Pause) Pause) i percentageGrade Language/Type: Related Links: C++ basics if/else interactive programs simpio.h What's wrong with the following code? Modify it to produce the intended output. Make sure to properly utilize if/else/if statements to avoid redundancy and avoid unnecessary tests. Do not use && or II in your solution. What percentage did you earn? 87 You got a B! 1 int percent= getInteger ("What percentage did you earn? "); 2 if (percent >= 98) { 3 cout << "You got an A!" << endl; 4) 5 if (percent >= 88) ( 6 cout << "You got a B!" << endl; 7) 8 if (percent >= 78) { 9 18) cout<< "You got a C!" << endl; 11 if (percent >= 68) { 12 cout << "You got a D!" << endl; 13) 14 if (percent < 68) { 15 16) Bare code. Write a fragment of C++ code as described, without any main function or heading around your code. ✔Submit cout << "You got an F!" << endl;
You are working on problem set: PS4 (Pause) Pause) i percentageGrade Language/Type: Related Links: C++ basics if/else interactive programs simpio.h What's wrong with the following code? Modify it to produce the intended output. Make sure to properly utilize if/else/if statements to avoid redundancy and avoid unnecessary tests. Do not use && or II in your solution. What percentage did you earn? 87 You got a B! 1 int percent= getInteger ("What percentage did you earn? "); 2 if (percent >= 98) { 3 cout << "You got an A!" << endl; 4) 5 if (percent >= 88) ( 6 cout << "You got a B!" << endl; 7) 8 if (percent >= 78) { 9 18) cout<< "You got a C!" << endl; 11 if (percent >= 68) { 12 cout << "You got a D!" << endl; 13) 14 if (percent < 68) { 15 16) Bare code. Write a fragment of C++ code as described, without any main function or heading around your code. ✔Submit cout << "You got an F!" << endl;
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27SA
Related questions
Topic Video
Question
100%
solve the problem from the image.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning