Question

using if/switch statements (C++) Write a grading program for a class with the following grading policies:...

using if/switch statements (C++)
Write a grading program for a class with the following grading policies:

There are two quizzes, each graded on the basis of 10 points
There is one midterm exam and one final exam, each graded on the basis of 100 points
The final exam counts for 50% of the grade, the midterm counts for 25% and the two quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They should be converted to a percent before they are averaged in).
Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of 70 or more (but less then 80) is a C, any grade of 60 or more (but less than 70) is a D, any grade below 60 is an F.


The program will read in the student’s score (two quiz and two exams) and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and the final letter grade.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:-

#include <iostream>
using namespace std;

int main()
{
int q1,q2,mt,ft;
  
cout << "Enter Quiz 1 Number(out of 10): ";
cin >> q1;
cout << "Enter Quiz 2 Number(out of 10): ";
cin >> q2;
cout << "Enter Mid-term Number(out of 100): ";
cin >> mt;
cout << "Enter Final-term Number(out of 100): ";
cin >> ft;
cout <<"<---------------------------Your Result------------------------->\n";
   cout << "Quiz -1 :"<<q1 <<"/10 \nQuiz -2 :"<<q2 <<"/10 \nMid-Term :" << mt <<"/100\nFinal-Term :"<<ft <<"/100 "<<endl;
  
   double qa=(q1+q2)/2;
   double avg=(0.5*ft)+(0.25*mt)+(2.5*qa);

cout << "Average Score: " << avg << endl;
    int grade=avg/10;
    switch(grade)
    {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
            cout << "Grade : F " ;
            break;
            case 6:
                cout << "Grade : D ";
                break;
                case 7:
                cout << "Grade : C ";
                break;
                    case 8:
                cout << "Grade : B ";
                break;
                    case 9:
                        case 10:
                cout << "Grade : A ";
                   
                break;
               
    }
  

return 0;

}

Output:-

C:\Users\user\Desktop\Untitled1.exe Enter Quiz 1 Number(out of 10): 10 Enter Quiz 2 Number(out of 10): 9 Enter Mid-term Numbe

Compiler - dev c++

Add a comment
Know the answer?
Add Answer to:
using if/switch statements (C++) Write a grading program for a class with the following grading policies:...
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 grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • C++ Write a program to calculate final grade in this class, for the scores given below...

    C++ Write a program to calculate final grade in this class, for the scores given below . Remember to exclude one lowest quiz score out of the 4 while initializing the array. Display final numeric score and letter grade. Use standard include <iostream> Implementation: Use arrays for quizzes, labs, projects and exams. Follow Sample Output for formatting. May use initialization lists for arrays. Weight distribution is as follows: Labs: 15% Projects: 20% Quizzes: 20% Exams: 25% Final Project: 20% Display...

  • Write a program to calculate your final grade in this class. Three(8) assignments have yet to...

    Write a program to calculate your final grade in this class. Three(8) assignments have yet to be graded: Quiz 7, Lab 7 and Final Project. Assume ungraded items receive a grade of 100 points. Remember to drop the lowest two quiz scores. Display final numeric score and letter grade. Implementation: Weight distribution is listed in canvas. Use arrays for quizzes, labs, projects and exams. You are allowed to use initialization lists for arrays. Use at least three (3) programmer defined...

  • c++ implement a student class Determine the final scores, letter grades, and rankings of all students...

    c++ implement a student class Determine the final scores, letter grades, and rankings of all students in a course. All records of the course will be stored in an input file, and a record of each student will include the first name, id, five quiz scores, two exam scores, and one final exam score. For this project, you will develop a program named cpp to determine the final scores, letter grades, and rankings of all students in a course. All...

  • Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might...

    Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might be worth 40% of your final grade. To calculate the grade for the Assignments category, the teacher takes the percentage earned on the assignments and multiplies it by the weight. So if the student earned a 90% total on the Assignments, the teacher would take 90% x 40, which means the student earned a 36 percent on the Assignments section. The teacher then calculates...

  • Grading Policy In addition to three in-class tests and a final exam, the final grade will...

    Grading Policy In addition to three in-class tests and a final exam, the final grade will include assessment of homework, quiz projects/classroom activities, and classroom participation, according to the following weights 1. Homework and Worksheets 2. Three Tests 3. Final Exam 4. Quizzes and Class Participation/Classroom Citizenshi 1 5% 40% 25% 20% Total 100% Grad Ran 92 100 90-91 88-89 82-87 80-81 an 78 -79 70-77 68 -69 66 67 60- 65 Assignment Grading: Each written assignment, except the Final...

  • C ++ . In professor Maximillian’s course, each student takes four exams. A student’s letter grade...

    C ++ . In professor Maximillian’s course, each student takes four exams. A student’s letter grade is determined by first calculating her weighted average as follows:                                                 (score1 + score2 + score3 + score4 + max_score) weighted_average = -----------------------------------------------------------------------                                                                                                 5 This counts her maximum score twice as much as each of the other scores. Her letter grade is then a A if weighted average is at least 90, a B if weighted average is at least 80...

  • Enter a number rounded to one decimal. The syllabus states that a midterm test will count...

    Enter a number rounded to one decimal. The syllabus states that a midterm test will count for 30% of a student's course grade. The midterm is the first graded test in the course. After the midterm, three more tests-including the final-are scheduled. The final test counts for 50% of the student's course grade and the remaining tests count equally toward the final grade. Any bonus on a test is added to the test score before the result is entered into...

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
ADVERTISEMENT