Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C + + , Write a complete error free program. 1 . Write a program that will input letter grades ( A , B
Using C Write a complete error free program.
Write a program that will input letter grades A B C D F the number of which is input by the user a maximum of grades The grades will be read into an array. A function will be called five times once for each letter grade and will return the total number of grades in that category. The input to the function will include the array, number of elements in the array and the letter category A B C D or F The program will print the number of grades that are A B etc.
Write a program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than temperatures. Use typedef to declare the array type. The average should be displayed to two decimal places.
Complete this program.
This program will read in a group of test scores positive integers from to
from the keyboard and then calculate and output the average score
as well as the highest and lowest score. There will be a maximum of scores.
PLACE YOUR NAME HERE
#include
using namespace std;
typedef int GradeType; declares a new data type:
an integer array of elements
float findAverageconst GradeType, int; finds average of all grades
int findHighestconst GradeType, int; finds highest of all grades
int findLowestconst GradeType, int; finds lowest of all grades
int main
GradeType grades; the array holding the grades.
int numberOfGrades; the number of grades read.
int pos; index to the array.
float avgOfGrades; contains the average of the grades.
int highestGrade; contains the highest grade.
int lowestGrade; contains the lowest grade.
Read in the values into the array
pos ;
cout "Please input a grade from to or to stop endl;
cin gradespos;
while gradespos
Fill in the code to read the grades
numberOfGrades ; Fill blank with appropriate identifier
call to the function to find average
avgOfGrades findAveragegrades numberOfGrades;
cout endl "The average of all the grades is avgOfGrades endl;
Fill in the call to the function that calculates highest grade
cout endl "The highest grade is highestGrade endl;
Fill in the call to the function that calculates lowest grade
Fill in code to write the lowest to the screen
return ;
findAverage
task: This function receives an array of integers and its size.
It finds and returns the average of the numbers in the array
data in: array of floating point numbers
data returned: average of the numbers in the array
float findAverageconst GradeType array, int size
float sum ; holds the sum of all the numbers
for int pos ; pos size; pos
sum sum arraypos;
return sum size; returns the average
findHighest
task: This function receives an array of integers and its size.
It finds and returns the highest value of the numbers in the array
data in: array of floating point numbers
data returned: highest value of the numbers in the array
int findHighestconst GradeType array, int size
Fill in the code for this function
findLowest
task: This function receives an array of integers and its size.
It finds and returns the lowest value of the numbers in the array
data in: array of floating point numbers
data returned: lowest value of the numbers in the array
int findLowestconst GradeType array, int size
Fill in the code for this function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started