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
What are three distractions that can prevent a driver from focusing on driving? Explain how a driver can prevent these distracti
DIA [1.3K]

Phone- turn it off

loud music - keep it turned down to a reasonable volume (cause you could start singing and get distracted)

other cars on the road - keep your eyes looking forward.

hope this helps.

8 0
3 years ago
Help!! Best answer will get Brainliest!!
Eddi Din [679]

Answer:

answer(s):

-set goals

-select a topic

-write down research questions

Hope this helped and sorry for the bold. <3

Explanation:

6 0
3 years ago
Read 2 more answers
What are the responsibilities of the DBA and the database designers?
Ratling [72]

Answer:

Explanation:

DBA's main responsibility is making sure that there is enough CPU, disk, memory, and network bandwidth available, as well as making backups every so often. Meanwhile, the database designers/developers are responsible for investigating and implementing what the end-user needs and making sure that the database holds all of the information that the end-user will be using.

3 0
3 years ago
Anna is making a presentation on the top five most visited cities in her state. she wants to make sure that she does not put in
andrey2020 [161]
Outline View. This view shows only the text of all the slides in the presentation on the left pane, enabling Anna to see whether she has put too much information or not.  She can also directly edit the the text  and simultaneously see its effect on the slide.  
8 0
3 years ago
Read 2 more answers
Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
vazorg [7]

Complete Question:

George, a user, is having trouble connecting to network resources, including shared folders on the local network and Internet resources. Yesterday he was able to connect with no problems. You need to ensure that he can connect to these resources. Which tool should you use FIRST?

Group of answer choices

A. ipconfig

B. Device Manager

C. My Network Places

D. Control Panel

Answer:

A. ipconfig

Explanation:

As a network administrator, to ensure that George can connect to the network resources, shared folders, and internet resources, the tool you should use first is the "ipconfig" in the command line. This is a troubleshooting process that would help to identify the problem and to establish a theory of probable cause.

<em>Since George could connect the previous day without any problem, it is most likely that the TCP/IP settings has been altered. Therefore, to view this settings you'll have to use an ipconfig command. </em>

4 0
4 years ago
Other questions:
  • Ayuda no encuentro el concepto de estas tres preguntas: ¿para qué sirve la administración en la ofimatica o informática? ¿Que so
    13·1 answer
  • This is C++
    10·1 answer
  • Consider the problem of finding the distance between the two closest numbers in an array of n numbers. (The distance between two
    13·1 answer
  • Which type of memory helps in reading as well as writing data? With the help of , a computer can read as well as write or modify
    11·3 answers
  • What will happen if you reverse the connection of IDE?<br>​
    9·1 answer
  • Computer science - algorithms - flowcharts
    11·1 answer
  • Who else is on spring break till april 12th?
    15·2 answers
  • Need help completing this coding assignment.
    11·1 answer
  • In the software development process, which review studies the software design before it is released for coding?
    7·1 answer
  • One benefit for a small business using the hosted software model for its enterprise software is that it can succeed without ____
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!