Question

Write a small c++ program, that does the following Prompts user to input a score between...

Write a small c++ program, that does the following

  • Prompts user to input a score between 1-10 (assume the user will honor the request)
  • Stores the user input in an appropriate variable (appropriate in type and name)
  • Checks if the score is a passing grade. Assume 70% or more is needed
  • Displays a message only if the score is passing.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>

using namespace std;

int main()

{

//declare the variable score

int score;

cout << "Enter your score(1-10):";

//cin reads the value from console and puts it in the variable

cin >> score;

//check if the score is greater than or equal to 7 (7/10 is 70 percent)

if(score>=7)

cout << "You have passed"; //Displaying the message

return 0;

}

note:If score is less than 7 nothing is printed

Add a comment
Know the answer?
Add Answer to:
Write a small c++ program, that does the following Prompts user to input a score between...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT