Question

C++ 1. Write a program that determines a student’s grade. The program will read three types...

C++

1. Write a program that determines a student’s grade. The program will read three types of scores

(quiz, mid-term, and final scores), calculate the average and determine the grade based on the

following rules:

90% and above: A

80%-89%: B

70%-79%: C

50%-60%: D

0-49%: F

Homework Answers

Answer #1
#include <iostream>

using namespace std;

char getLetterGrade(double 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';
    return letter;
}

int main(){
   double quiz, midTerm, final, avg;
   
   cout<<"Enter quiz score: ";
   cin>>quiz;
   
   cout<<"Enter mid term score: ";
   cin>>midTerm;
   
   cout<<"Enter final score: ";
   cin>>final;
   
   avg = (quiz + midTerm + final)/3;
   
   cout<<"Average = "<<avg<<endl;
   
   cout<<"Letter grade = "<<getLetterGrade(avg)<<endl;
   
   return 0;
}
   
Know the answer?
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
Similar Questions
In Python... Write a program that calculates a student’s final grade in this course. The program...
In Python... Write a program that calculates a student’s final grade in this course. The program should: Display a message stating its goal Prompt the user to enter a student’s average grade for the weekly assignments, grade for mid-course project and grade for final project Calculate the final grade based on these percentages... Assignments = 60% Mid-course & Final Project = 40% (20% each) A A- B+ B B- C+ C C- D+ D D- E 100-94 93-89 88-85 84-82...
You are to write a program that will process students and their grades. For each student...
You are to write a program that will process students and their grades. For each student the program will read in a student’s name. It should also read in 10 test scores for the student and calculate his or her average. You must read the scores using a loop. The program should output the student’s name, average and letter grade. The average should be displayed accurate to 1 decimal digit. Letter grades are assigned based on the scale: 90-100    A...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE...
Write a Java program to display a letter grade based on an actual grade. USING ECLIPSE IDE A = 90-100 B = 80-89 C = 70-79 D = 60-69 F = less than 60 The program needs to do the following: 1. Create a short integer to store a grade. (See Week 3 - Things to Know - Java Data Types ) 2. Prompt for a grade ( 0-100). 3. Based on the grade given, use IF statements to display...
Write a Java program to display a letter grade based on an actual grade. A =...
Write a Java program to display a letter grade based on an actual grade. A = 90-100 B = 80-89 C = 70-79 D = 60-69 F = less than 60 The program needs to do the following: 1. Create a short integer to store a grade. (See Week 3 - Things to Know - Java Data Types ) 2. Prompt for a grade ( 0-100). 3. Based on the grade given, use IF statements to display the letter grade...
Write a program that keeps reading a test score until a -1 is entered. The program...
Write a program that keeps reading a test score until a -1 is entered. The program will output the letter grade according to the table below: Score Grade 90-100.   A 80-89.   B 70-79.   C 60-69.   D < 60.   F For example: Enter a Score (-1 to Exit): 92 The Letter grade for that score is A. Enter a Score (-1 to Exit): -1
Write a program in C to find the student’s eligibility for admission into some academic program....
Write a program in C to find the student’s eligibility for admission into some academic program. Ask the user to enter three grades for Maths, Physics, and Chemistry. Then if: The student’s grade in Math is greater than 80 and in Physics is greater than 70, the student is eligible to study Engineering. The student’s grade in Physics is greater than 80 or Chemistry is greater than 90, the student is eligible to study Sciences. Otherwise, the student is not...
-- 3. Create a variable to store a numeric grade -- Write a CASE statement that...
-- 3. Create a variable to store a numeric grade -- Write a CASE statement that uses the variable to calculate a letter grade -- If the numeric grade is above 100 or below 0, return "Invalid grade" -- A = 90-100, B = 80-89, C = 70-79, D = 60-69, F = 0-59 -- Hint: SELECT doesn't always require a FROM clause
C++ Write a program which accepts a numeric test score from the user. It will output...
C++ Write a program which accepts a numeric test score from the user. It will output the letter grade to the user corresponding to the score. Assume no “minus grades” (an A ranges from 90-100, B ranges from 80-89, C ranges from 70-79, D ranges from 60-69 and F is everything else.) Ensure that the score remains in the range of 0 to 100. As an example of the output: Enter your numeric grade and I will tell you your...
create a complete C++ program that will read from a file, "studentInfo.txt", the user ID for...
create a complete C++ program that will read from a file, "studentInfo.txt", the user ID for a student (first letter of their first name connected to their last name i.e. jSmith). Next it will need to read three integer values that will represent the 3 e xam scores the student got for the semester. Once the values are read and stored in descriptive variables it will then need to calculate a weighted course average for that student. Below is an...
It’s that time again. Time for Mr. Brummett to calculate each student’s overall grade. However, it’s...
It’s that time again. Time for Mr. Brummett to calculate each student’s overall grade. However, it’s much easier to do it in Python. In this assignment your goal is to write a python program called grade.py that takes in the student’s name, 6 quiz grades, 4 test grades, 6 project grades, and a participation grade. The program should also take in the weighted percentage of each type of assignment (for example Participation is usually 5% of the total grade) as...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT