Question

Write a C++ program that asks the user for an exam score. The program displays on...

Write a C++ program that asks the user for an exam score. The program displays on the screen the appropriate later grade as per the schema below: a. A: [90-100] b. B: [80:89] c. C: [70:79] d. D: [60:69] e. F: otherwise

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include<iostream>
using namespace std;

int main()
{
   double score;
   
   cout<<"Enter score: ";
   cin>>score;
   
    char letter;
   if(score < 60)
        letter = 'F';
    else if(score < 70)
        letter = 'D';
    else if(score < 80)
        letter = 'C';
    else if(score < 90)
        letter = 'B';
    else
        letter = 'A';
        
    cout<<"Letter grade = "<<letter<<endl;
   return 0;
}

Add a comment
Know the answer?
Add Answer to:
Write a C++ program that asks the user for an exam score. The program displays on...
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
  • Write a program that asks the user to enter five test scores. The program should display...

    Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...

  • C++ 1. Write a program to check if two values are equal. The output should give...

    C++ 1. Write a program to check if two values are equal. The output should give the response "Both a and b are the same" or "a and b are not the same". 2. Write a program to take a test score and determine the grade A is 90-100, B is 80-89, C is 70-79, D is 60-69, F is 60 or below. BONUS - check for input validation (score over 100 or under 0)

  • A web page displays an input box that a user can use to a enter a...

    A web page displays an input box that a user can use to a enter a grade from a test and a button that when pressed tells the user what letter grade they received for that test. Assume that the grade is stored in an integer named grade and you will put the letter grade in to a string variable named letter. Write one or more if-statements in Javascript that will set the correct value into letter assuming the standard...

  • [Using Python] Use the grade scale in the syllabus for this class, write a program that...

    [Using Python] Use the grade scale in the syllabus for this class, write a program that inputs a score, and prints the grade for that score. For example, if I input 90.0, your program should print A. Grading Scale is: 100% - 90% A 89% - 80% B 79% - 70% C 69% - 60% D 59% - 0% E

  • Write a C++ program that will provide a user with a grade range if they enter...

    Write a C++ program that will provide a user with a grade range if they enter a letter grade. Your program should contain one function. Your function will accept one argument of type char and will not return anything (the return type will be void), but rather print statements to the console. Your main function will contain code to prompt the user to enter a letter grade. It will pass the letter grade entered by the user to your function....

  • Question: How do I write a program in C# that calculates a student's final grade for...

    Question: How do I write a program in C# that calculates a student's final grade for a test with 20 multiple questions using arrays and helper methods? Instructions: (0-incorrect answer, 1-correct answer) If the student answered the question right, add 5 points to the running total. If the student didn’t answer correctly subtract .5 points from the running total. The running total is initialized with 5 points (so the student receives 5 points extra credit). To define the final grade...

  • In python, Write a program to output grades A, B, C, D, F depending on the...

    In python, Write a program to output grades A, B, C, D, F depending on the scores to be lying between 90 and 100, 80 and 89, 70 and 79, 60 and 69 (inclusive of the end points). If the user inputs numbers less than zero or greater than 100, print “Error! Try again!” Thank you

  • 1. Create a program that takes a numerical score and outputs a letter grade. 2. In...

    1. Create a program that takes a numerical score and outputs a letter grade. 2. In this program, create two void functions titled makeScore and theGrade with an int argument. 3. The function makeScore should have a Reference parameter and theGrade should have a Value parameter. Note: Specific numerical scores and letter grades are listed below: 90-100 = Grade A 80-89 = Grade B 70-79 = Grade C 60-69 = Grade D 0-59 = Grade F 4. The function makeScore...

  • Grade on Statistics Exam Frequency Below 50 50 59 60-69 70-79 80- 89 90 100 10...

    Grade on Statistics Exam Frequency Below 50 50 59 60-69 70-79 80- 89 90 100 10 13 17 Given the frequency table above, construct the following: (a) The relative frequency table that corresponds with the above ta Grade on Statistics Exam Relative Frequency Below 50 50 59 60 - 69 70 79 80 - 89 90 100 (b) The cumulative frequency table that corresponds with the abov Grade on Statistics Exam Cumulative Frequency Below 50 50 59 60- 69 70...

  • This program should be written in C Thoroughly following the Code Conventions, write an efficient program,...

    This program should be written in C Thoroughly following the Code Conventions, write an efficient program, which ask the user for their numeric grade, and determines and displays the equivalent letter grade, based on the following information: Use appropriate data types and initialize the variables correctly Use the following grading scale: A: 90 - 100 B: 80 - < 90 C: 70 - < 80 D: 60 - < 70 F: 0 - < 60 If the input is invalid,...

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