Question

In: Computer Science

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

Write a program that determines a student’s grade. The program will read three types of scores
(quiz, mid-term, and final scores) and determine the grade based on the following rules:
-if the average score =90% =>grade=A
-if the average score >= 70% and <90% => grade=B
-if the average score>=50% and <70% =>grade=C
-if the average score<50% =>grade=F

Using Switch Statement

Need to code to be simple to understand. No pointers should be used

Solutions

Expert Solution

Required Program in C ++ -->


#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int quiz, miterm, final; //declare variables
cin>>quiz; //read quiz marks
cin>>miterm; //read miterm marks
cin>>final; //read final marks
float average =(quiz+miterm+final)/3; //find the average of the three
int x = average/10; //store the value of average when divided by 10 in integer format
switch(x){ //switch for x
case 0:
case 1:
case 2:
case 3:
case 4: cout<<"Grade = F"; //if case 0,1,2,3,4 then display F
break; //break
case 5:
case 6: cout<<"Grade = C"; //if case 5,6 then display C
break; //break
case 7:
case 8: cout<<"Grade = B"; //if case 7,8 then display B
break; //break
case 9:
case 10: cout<<"Grade = A"; //if case 9,10 then display A
break; //break
default:cout<<"Please Enter correct marks"; //if any other, then ask the user to enter correct values
}
return 0;
}

if marks are -> 50, 100, 50 -> then its average will be 200/3 = 66.67

and when 66.67 is divided by 10, its integer value will be 6, and then case 6 will be executed which will display C.


Related Solutions

Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade...
Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade and the program will determine if that grade is an A, B, C, D, or E. The student can only enter number 0-100. A = 90-100 B = 80-89 C = 70-79 D= 60-69 E = 59 or less Save the file as Lab3.4 and submit the file. Use https://repl.it/ THIS LANGUAGE IS PYTHON Thank you :)
Write a c++ program that given a set of letter grade/credit hour combiniation, determines the grade...
Write a c++ program that given a set of letter grade/credit hour combiniation, determines the grade point average (GPA) Each A is worth 4 points. Each B is worth 3 points. Each C is worth 2 points. Each D is worth 1 point, and Each F is worth 0 points. The total quality points earned is the sum of the product of letter grade points and associated course credit hours. The GPA is the quotient of the quality points divided...
write a program that will display student grade if scores is greater than or equal to...
write a program that will display student grade if scores is greater than or equal to 70 to display A or else if score is less than or equal to 70 and greater than or equal to 60 display B if scores is less than 60 or greater than 50 display C else display fail.
(C++) Write a program to read from a grade database (data.txt). The database (text file) has...
(C++) Write a program to read from a grade database (data.txt). The database (text file) has students names, and grades for 10 quizzes.Use the given function prototypes to write the functions. Have main call your functions. The arrays should be declared in main() and passed to the functions as parameters. This is an exercise in parallel arrays, int and char 2 dim arrays. Function prototypes: int readData(ifstream &iFile, int scores[][10], char names[][30]); This functions takes the file stream parameter inFile...
write a Java program Write a program to assign a letter grade according to the following...
write a Java program Write a program to assign a letter grade according to the following scheme: A: total score >= 90 B: 80 <= total score < 90 C: 70 <= total score < 80 D: 60 <= total score < 70 F: total score < 60 Output - the student's total score (float, 2 decimals) and letter grade Testing - test your program with the following input data: test1 = 95; test2 = 80; final = 90; assignments...
Write a C program that will read different data types from the following file and store...
Write a C program that will read different data types from the following file and store it in the array of structures. Given file: (This file have more than 1000 lines of similar data): time latitude longitude depth mag magType nst gap dmin 2020-10-19T23:28:33.400Z 61.342 -147.3997 12.3 1.6 ml 12 84 0.00021 2020-10-19T23:26:49.460Z 38.838501 -122.82684 1.54 0.57 md 11 81 0.006757 2020-10-19T23:17:28.720Z 35.0501667 -117.6545 0.29 1.51 ml 17 77 0.1205 2020-10-19T22:47:44.770Z 38.187 -117.7385 10.8 1.5 ml 15 100.22 0.049 2020-10-19T22:42:26.224Z...
PL/SQL Write a PL/SQL block, using a Case Statement that prints a student’s letter     grade...
PL/SQL Write a PL/SQL block, using a Case Statement that prints a student’s letter     grade based on the value stored in a variable called grade. Use the ACC      grading system described in the course syllabus to create the block and set     the initial value of grade as 95. Use only one print statement and no      logical operators in your code. Assume a grade can exceed 100, but it      can’t be negative. Grade Scale: Grade Scale:...
PYTHON PROGRAM: Write a program that determines the day of the week for any given calendar...
PYTHON PROGRAM: Write a program that determines the day of the week for any given calendar date after January 1, 1900, which was a Monday. This program will need to account for leap years, which occur in every year that is divisible by 4, except for years that are divisible by 100 but are not divisible by 400. For example, 1900 was not a leap year, but 2000 was a leap year.
C++ Write a program that asks a teacher to input a student’s first name, last name,...
C++ Write a program that asks a teacher to input a student’s first name, last name, and four test scores. The program should find the average of the four test scores and should then write the following information to a file named “students.txt” last_name first_name average A student's first name of “XX” should be used as a sentinel value and no numeric grades less than 0 or greater than 100 should be accepted.  The program should then read the information in...
Formally assess whether or not the estimated differences in the mean scores (grade) for the three...
Formally assess whether or not the estimated differences in the mean scores (grade) for the three positions (front, middle, and back) are statistically significant, providing numerical justification (test statistic and P-value) for your conclusion. If you find a significant difference among the positions, then investigate which positions differ significantly from each other. You can ignore prevGPA. DATA two; INPUT grade position $ prevGPA; cards; 93.2 front 3.78 88.4 front 3.52 65.4 front 2.67 56.3 front 2.23 73.6 front 3.21 44.3...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT