1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sidana [21]
3 years ago
5

//TO-DO: Fill in the Authors Name Here//TO-DO: Fill in the current date here//CS1428 Lab//Lab 10//Description: this program will

find letter grades from 5 number grades#include using namespace std;double getAverage(double g[], const int SIZE){ double total = 0; for(int i = 0; i < SIZE; i++) { total += g[i]; } return total / SIZE;}void getGrades(double g[], const int SIZE){ cout << "Please enter 5 grades:" << endl; for(int i = 0; i < SIZE; i++) { cin >> g[i]; }}// TODO: Complete function definitionsint main(){ const int SIZE = 5; double grades[SIZE], average; int numberOfAs = 0, numberOfBs = 0, numberOfCs = 0, numberOfDs = 0, numberOfFs = 0; //TODO: Add function calls return 0;}
Computers and Technology
1 answer:
slamgirl [31]3 years ago
7 0

Answer:

countLetterGrades:

void countLetterGrades(double grades[], const int SIZE, int &numberOfAs,int &numberOfBs,int &numberOfCs,int &numberOfDs,int &numberOfFs) {

for(int i = 0; i < SIZE; i++){

if(grades[i]>85){numberOfAs++;}

else if(grades[i]>75){numberOfBs++;}

else if(grades[i]>65){numberOfCs++;}

else if(grades[i]>55){numberOfDs++;}

else{ numberOfFs++;}

}

}

printData:

void printData(double average, int numberOfAs,int numberOfBs,int numberOfCs,int numberOfDs,int numberOfFs)

{

cout<<"Average: "<<average<<endl;

cout<<"Number of A's: "<<numberOfAs<<endl;

cout<<"Number of B's: "<<numberOfBs<<endl;

cout<<"Number of C's: "<<numberOfCs<<endl;

cout<<"Number of D's: "<<numberOfDs<<endl;

cout<<"Number of F's: "<<numberOfFs<<endl;  

}

Explanation:

<em>Your question is poorly formatted. (See attachment for proper presentation of question)</em>

------------------------------------------------------------------------------------------------------------

The first step is to go to the main function and replace

//TODO: Add function calls

with the following 4 lines of code:

<em>getGrades(grades,SIZE); </em>

<em>average = getAverage(grades,SIZE); </em>

<em>countLetterGrades(grades, SIZE, numberOfAs,numberOfBs,numberOfCs,numberOfDs,numberOfFs); </em>

<em>printData(average, numberOfAs,numberOfBs,numberOfCs,numberOfDs,numberOfFs); </em>

------------------------------------------------------------------------------------------------------------

1. getGrades(grades,SIZE);

This calls the getGrade functions; The getGrade function is where the user inputs 5 grades for a student

2. average = getAverage(grades,SIZE);

Next, is to get the average of the input grades. This is done using the above and the average is stored in variable average

3. countLetterGrades(grades, SIZE, numberOfAs,numberOfBs,numberOfCs,numberOfDs,numberOfFs);

Next, is to get letter grade of each number grade. This is done using countLetterGrades function.

4. printData(average, numberOfAs,numberOfBs,numberOfCs,numberOfDs,numberOfFs);

The above 3 functions populate data for average, numberofAs to numberofFs; This values are passed to printData function to to display program output.

------------------------------------------------------------------------------------------------------------

Next complete countLetterGrades and printData functions as seen in the answer section.

<em>For clarity, see the attached cpp file for line by line explanation of the complete code </em>

You might be interested in
What shoul i get, Airpods or a ps4 cooling fan ???
Fynjy0 [20]

Answer:

Airpods, there is ps5 coming out

Explanation:

3 0
3 years ago
Read 2 more answers
Which of the following strategies will help you to stay focused and on topic while writing your essay?
AveGali [126]

Answer:

the answer is D,both A and B

8 0
3 years ago
Read 2 more answers
List and describe two of the four generally recognized security positions.
Llana [10]
CISO: This person reports directly to the CIO and is responsible for assessing, managing, and implementing security.
Security Technician: Entry-level position and provides technical support to conFgure security hardware, implement security software, and diagnose and troubleshoot <span>problems</span>
8 0
4 years ago
What role does the chipset play in the function of the computer
Iteru [2.4K]
Storing memory maybe hope thishelped
5 0
4 years ago
¿Cómo las ciencias sociales y la tecnología han modificado tu comunidad?
sergeinik [125]

Answer:

La ciencia y la tecnología han tenido un gran impacto en la sociedad y su impacto está creciendo. ... Al hacer la vida más fácil, la ciencia le ha dado al hombre la oportunidad de perseguir preocupaciones sociales como la ética, la estética, la educación y la justicia; crear culturas; y mejorar las condiciones humanas.

4 0
3 years ago
Other questions:
  • Which motherboard slot has direct access to the north bridge?
    7·1 answer
  • What happened to motion pictures when television became popular?
    8·1 answer
  • Does anyone know this page for drivers ed?
    9·1 answer
  • Which is the best description of the difference between bound and unbound forms? O Bound forms are similar to hierarchical forms
    7·1 answer
  • Steps to log out of an email account ​
    5·2 answers
  • What is the simplest way to permanently get rid of an unwanted file?
    9·1 answer
  • Before going into space, astronauts spend many hours training on flight simulators allowing them to learn how to fly without lif
    10·1 answer
  • Modify the NumberedList class we implementd during the lecture by adding a member function: void NumberedList::insertPosition(in
    13·1 answer
  • 72. In Object Oriented Programming, a class_____ starts
    12·1 answer
  • Help PLEASE ILL MARK as brainlest
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!