C++
Use C++ functions and build a program that does the most basic job all students have to contend with, process the grades on a test and produce a summary of the results. The big wrinkle is, it should be a multi-file program.
-Requires three simple things:
Below is your code: -
gradeHelper.cpp
#include<iostream>
using namespace std;
int maxValue(int grades[], int size) {
int max = 0;
for(int i = 0;i < size; i++) {
if(max < grades[i]) {
max =
grades[i];
}
}
return max;
}
int minValue(int grades[], int size) {
int min = grades[0];
for(int i = 0;i < size; i++) {
if(min > grades[i]) {
min =
grades[i];
}
}
return min;
}
char getLetterGrade(int grade_num) {
char letter;
if (grade_num<=60) {
letter = 'F';
}
else if ( grade_num<=69) {
letter = 'D';
}
else if (grade_num<=79) {
letter = 'C';
}
else if (grade_num<=89) {
letter = 'B';
}
else if(grade_num<=100) {
letter = 'A';
}
return letter;
}
gradeTester.cpp
#include<iostream>
#include "gradeHelper.cpp"
int main() {
int grades[15] = { 55, 87, 93, 77, 92, 88, 67, 81, 84,
73, 81, 92, 89, 100, 62 };
int max = maxValue(grades,15);
int min = minValue(grades,15);
cout<<"Grades entered: ";
for(int i = 0; i< 15; i++) {
cout<<grades[i]<<"
";
}
cout<<"\n\nMaximum Score:
"<<max<<endl;
cout<<"Minimum Score:
"<<min<<endl;
cout<<"\nGrades Summary: "<<endl;
cout<<"\nScore\t\tGrade"<<endl;
for(int i = 0; i< 15; i++) {
cout<<grades[i]<<"\t\t"<<getLetterGrade(grades[i])<<endl;
}
}
Output
Grades entered: 55 87 93 77 92 88 67 81 84 73 81 92 89 100 62
Maximum Score: 100
Minimum Score: 55
Grades Summary:
Score Grade
55 F
87 B
93 A
77 C
92 A
88 B
67 D
81 B
84 B
73 C
81 B
92 A
89 B
100 A
62 D
C++ Use C++ functions and build a program that does the most basic job all students...
Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...
Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...
SOLVE IN PYTHON:Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array....
In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a test grade (integer value) for each student in a class. Validation Tests are graded on a 100 point scale with a 5 point bonus question. So a valid grade should be 0 through 105, inclusive. Processing Your program should work for any...
Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array. The program...
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...
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: Round the average...
In Java Main method Your main program will prompt the user for a test name and the number of scores the user will enter. After creating an arraylist to hold the scores, prompt the user for all the scores to hold in the arraylist. After all the scores are entered, then repeat back the score & letter grade. GradeBook Object Create an instance of a GradeBook object and pass the test name and arraylist to set the instance variables. At...
Create a C++ program to : Prompt user for seven test score Store the scores into an array Print the array before and after sorting Print the test average Convert the average to letter grade Search for a test score 90, using linear search Print, if test score 90 was found and at what position Add Comments SEPARATE THE FILES INTO 3 : header.h, functions.cpp, main.cpp
Create a C++ program to : Prompt user for seven test score Store the scores into an array Print the array before and after sorting Print the test average Convert the average to letter grade Search for a test score 90, using linear search Print, if test score 90 was found and at what position Add Comments SEPARATE THE FILES INTO 3 : header.h, functions.cpp, main.cpp