Question
Help me write the program in C++ Thanks
Program #1: Calculate a students grade for a class. The class has 4 categories of grades. Each category has different weight
0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE

#include <iostream> using namespace std; char getGrade(int score) if(score >= 90) return A; if(score >= 80) return B; if(

SAMPLE INPUT

John
Nash
Computers
Three
60 80 70.5
49 28 60
97
70 76 79

SAMPLE OUTPUT

First name is John Last name is Nash Course is Computers Semester is Three Exams Grade is C Exam1 = 60 Exam2 = 80 Exam3 = 70.

CODE TO COPY

#include <iostream>
using namespace std;

char getGrade(int score)
{
if(score >= 90)
return 'A';
if(score >= 80)
return 'B';
if(score >= 70)
return 'C';
if(score >= 60)
return 'D';
return 'F';
}

int main() {
string fname, lname, course, semester;
cout << "Enter first name followed by last name: ";
cin >> fname >> lname;
  
cout << "Enter course followed by semester: ";
cin >> course >> semester;
cout << endl;
  
float e1, e2, e3, l1, l2, l3, proj, q1, q2, q3, e, l, q, finale;
  
cin >> e1 >> e2 >> e3;
cin >> l1 >> l2 >> l3;
cin >> proj;
cin >> q1 >> q2 >> q3;
  
e = (e1+e2+e3) / 3.0;
l = (l1+l2+l3) / 3.0;
q = (q1+q2+q3) / 3.0;
  
cout << "First name is " << fname << endl;
cout << "Last name is " << lname << endl;
cout << "Course is " << course << endl;
cout << "Semester is " << semester << endl;
  
cout << endl << "Exams Grade is " << getGrade(e) << endl << "\t Exam1 = " << e1 << endl << "\t Exam2 = " << e2 << endl << "\t Exam3 = " << e3 << endl;
cout << endl << "Labs Grade is " << getGrade(l) << endl << "\t Lab1 = " << l1 << endl << "\t Lab2 = " << l2 << endl << "\t Lab3 = " << l3 << endl;
cout << endl << "Project = " << proj << endl;
cout << "Project grade is " << getGrade(proj) << endl;
cout << endl << "Quizzes Grade is " << getGrade(q) << endl << "\t Quiz1 = " << q1 << endl << "\t Quiz2 = " << q2 << endl << "\t Quiz3 = " << q3 << endl;
  
finale = e*0.3 + l*0.3 + proj*0.3 + q*0.1;
cout << endl << "Final score = " << finale << endl;
cout << "Final grade = " << getGrade(finale) << endl;
}

// Please up vote. Happy Learning!

Add a comment
Know the answer?
Add Answer to:
Help me write the program in C++ Thanks Program #1: Calculate a student's grade for a...
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
  • 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...

  • Language: C++ Write a program that will allow the instructor to enter the student's names, student...

    Language: C++ Write a program that will allow the instructor to enter the student's names, student ID, and their scores on the various exams and projects. A class has a number of students during a semester. Those students take 4 quizzes, one midterm, and one final project. All quizzes weights add up to 40% of the overall grade. The midterm exam is 25% while the final project 35%. The program will issue a report. The report will show individual grades...

  • A students grades and weights are given below, calculate the final grade by calculating a weighted...

    A students grades and weights are given below, calculate the final grade by calculating a weighted average. (Data given in image) Calculate the students final grade: ____% A student's grades and weights are given below. Calculate the final grade by calculating a weighted average. Category Grade Earned Weight of Grade 15% 10% 25% 509% In-class Work61.8% 80.79% 51.7% 56.29% Homework Quizzes Exams 96 Calculate the student's final grade: Round your answer to one decimal place

  • In a student's French class, the final grade is based on six categories. The categories, grades,...

    In a student's French class, the final grade is based on six categories. The categories, grades, and weights are shown in this table. CategoryGradeWeight % Test 15216 Test25820 Test 37018 Homework716 Semester Project907 Final Exam7133 Compute a weighted average to determine the student's overall final grade in the course. Record the overall final grade below as a percentage. Round accurately to two decimal places. Final Grade: %

  • This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp,...

    This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and Main.cpp 1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for...

  • 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...

  • A student's grade in decision analysis course is comprised of tests (30%), quizzes (20%), papers (20%),...

    A student's grade in decision analysis course is comprised of tests (30%), quizzes (20%), papers (20%), and a discussion (20%), participation (10%). His scores for each of the categories are 85 (quizzes), 75 (discussions), 92 (papers) and 84 (participation) and 70 tests. Calculate his overall grade.

  • 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:-...

  • Visual Basic (VB) Code on Visual Studio Code a Visual Basic (VB) program that calculates the...

    Visual Basic (VB) Code on Visual Studio Code a Visual Basic (VB) program that calculates the final grade a school course. The program will ask the user to enter ten grades for assignments (each is out of 25), five grades for quizzes (each out of 30), a midterm grade out of 300, extra-credit final project points (out of 100), final test points (out of 300) The program will add all of the points you entered and show you a letter...

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