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
nevsk [136]
3 years ago
10

Write a C++ program that manage the student’s grades. Starting with a fixed number of students (use 10 for simplicity) the user

will input the grades for each student. The number of grades is given by the user. The grades are stored in an array. Two functions are called for each student. One function will give the numeric average of their grades. The other function will give a letter grade to that average. Grades are assigned on a 10-point spread. 90-100 A 80- 89 B 70-79 C 60-69 D Below 60 F
Computers and Technology
1 answer:
BigorU [14]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

float findAverage(double grades[], int numOfgrades) {

   float sum = 0;

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

       sum += grades[i];

   }

   return (sum / numOfgrades);

}

char findLetterGrade(double grades[], int numOfgrades) {

   char letter;

   if(findAverage(grades, numOfgrades) >= 90 && findAverage(grades, numOfgrades) <= 100)

       letter = 'A';

   else if(findAverage(grades, numOfgrades) >= 80 && findAverage(grades, numOfgrades) <= 89)

       letter = 'B';

   else if(findAverage(grades, numOfgrades) >= 70 && findAverage(grades, numOfgrades) <= 79)

       letter = 'C';

   else if(findAverage(grades, numOfgrades) >= 60 && findAverage(grades, numOfgrades) <= 69)

       letter = 'D';

   else if(findAverage(grades, numOfgrades) >= 0 && findAverage(grades, numOfgrades) <= 59)

       letter = 'F';

       

   return letter;

}

int main()

{

   int numOfgrades, grade;

   

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

       cout<<"Enter the number of grades for student #" << i+1 <<": ";

       cin >> numOfgrades;

       double grades[numOfgrades];

       

       for (int j = 0; j < numOfgrades; j++) {

           cout<<"Enter the grade" << j+1 <<" for student #" << i+1 <<": ";

           cin >> grade;

           grades[j] = grade;

       }

       cout << "Student #" << i+1 << " got " << findLetterGrade(grades, numOfgrades) << endl;

   }

   

   return 0;

}

Explanation:

Create a function named findAverage that takes two parameters, grades array and numOfgrades

Inside the function, create a for loop that iterates through the grades and calculates the sum of the grades. Then, return the average, sum/numOfgrades

Create another function named findLetterGrade that takes two parameters, grades array and numOfgrades

Inside the function, check the average grade by calling the findAverage() function. Set the letter grade using the given ranges. For example, if the result returned from findAverage() function is between 80 and 89, set the letter to 'B'. Then, return the letter.

In the main:

Create a for loop that iterates for each student, in this case 10 students. Inside the loop:

Ask the user to enter the number of grades for student. Using this value, create a grades array.

Create another for loop (inner for loop) that will set the grades array using the values entered by the user.

When the inner loop is done, call the findLetterGrade() function passing the grades array and numOfgrades as parameter and print the result

You might be interested in
A power ratio of 9000000:1 corresponds to ... dB?
sertanlavr [38]

Answer:

69.54

Explanation:

A power ratio of 9000000:1 corresponds to 69.54 dB.

The calculation is presented below:

Formula for calculating Power ratio (db) = 10 * log [P(out)/P(in)]

Since the given ratio is 9000000:1, substituting in the formula gives us 10 * log (9000000/1)

Note that log 9000000 = 6.954

Therefore, 10 * log (9000000/1) = 69.54

Hence the required power ratio in db is 69.54 db.

4 0
3 years ago
You are trying to access the Wi-Fi network at a coffee shop. What protocol will this type of wireless networking most likely use
Anna71 [15]

The wireless network is called WAP protocol

8 0
3 years ago
How do you get access To The advance server in Mobile legends
kiruha [24]

Answer: To enter the Advanced Server, please follow the below instructions: Tap into the Profile section and click Account Settings. Tap on the Switch Server button on the bottom right of the screen. This will allow the player to switch between the Original Server and Advanced Server.

Explanation: I play Mobile legends a lot so I know this

4 0
3 years ago
All of the following are aspects of the search process except
Len [333]
You need to provide the options or we cant provide you with the incorrect answer.
8 0
3 years ago
Which of the following scenarios describes an IT
slava [35]

Answer:

-checking social media networks during working hours

-surfing the Internet during working hours for what to do on the weekend

-downloading a favorite band’s latest album from a file-sharing service

Explanation:

they are all correct on edg.

8 0
3 years ago
Read 2 more answers
Other questions:
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • When you sort a cell range using a to z or z to a, what is rearranged?
    5·1 answer
  • Are there protections for people in terms of what data can be collected by different sites?
    10·1 answer
  • Why is fragmentation of an ip packet sometimes required?
    12·1 answer
  • What type of font color should Kim select if she chooses a dark-colored design theme for her presentation?
    11·2 answers
  • echnician A says that underinflation can increase the rolling resistance of a tire. Technician B says that underinflation can ca
    9·1 answer
  • What are the top ten alternative songs of the 2000's?
    7·1 answer
  • Atheel tests a program and gets a NameError. How can this be fixed?
    13·2 answers
  • What is the remainder obtained by dividing x 7 + x 5 + 1 by the generator polynomial x 3 + 1?
    9·1 answer
  • HELP GENIUS Rank :))) DoNT answer If you don't know
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!