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
Respond to the following in three to five sentences. Select the workplace skill, habit, or attitude described in this chapter (a
Katyanochek1 [597]

Answer:

communication and proactive

Explanation:

Communication is the most important thing and not only for a successful employee, is for successful life, in a company, there are a lot of people working in different areas, and sometimes we must interact with other departments to complete the task, a good communication help us to create a good experience and relationship with our partners, we're going to get efficient results.

If we want to ask more resources to our boss, we must show the needs and the benefits that company going to get, with a good presentation, inform and communication this can be easy to do, or if we are the boss, and we want to give trust our employees, we must have a good communication skills.

If we are proactive, we are going to result in almost every problem, in some companies the training is bad, we must learn process and attitudes for our job, some people are stingy with the knowledge, and we must find solution for our self, in this way we're going to be more independent, and our value increase in the company and even in the working market.

7 0
3 years ago
Choose the correct item. Check your answers in the text.<br>3​
RSB [31]

Answer:

You should do that

Explanation:

You didnt say anything

5 0
3 years ago
Find the number of ways in which a committee of 4 can be chosen from six boys and
natima [27]

Answer:

465 ways

Explanation:

Atleast 1 girl and 1 boy

Possible combinations :

1 girl ; 3 boys = 6C1 ; 6C3

2 girls ; 2 boys = 6C2 ; 6C2

3 girls ; 1 boy = 6C3 ; 6C1

(6C1 * 6C3) + (6C2 * 6C2) + (6C3 * 6C1)

Combination formula:

nCr = n! ÷ (n-r)!r!

We can also use a calculator :

6C1 = 6

6C3 = 20

6C2 = 15

Hence,

(6C1 * 6C3) + (6C2 * 6C2) + (6C3 * 6C1)

(6 * 20) + (15 * 15) + (20 * 6)

120 + 225 + 120

= 465 ways

6 0
2 years ago
Requirements description:
Andrews [41]

Answer:

The code has been written in Java.

The source code of the file has been attached to this response. The source code contains comments explaining important lines of the program.

A sample output got from a run of the application has also been attached.

To interact with the program, kindly copy the code into your Java IDE and save as Cafe.java and then run the program.

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
75f69c356ebff0797de4ffcfb6f8c22e.png
8 0
3 years ago
ANSWER QUICKLY!!
ehidna [41]

Answer: The answer is Proximity.

Explanation:

4 0
2 years ago
Other questions:
  • Do we have to use intersection?
    6·1 answer
  • A tool you might use to manipulate an image, such as a photograph, into a seamless repeating texture would be:
    7·2 answers
  • Which of the following is a name for the place an information services and support professional might work? software development
    15·2 answers
  • Which of the following involves writing hidden messages so that only the sender and intended recipient know a message exists? St
    5·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    15·1 answer
  • A(n) ____ local area network is a network in which devices use high-frequency radio waves to communicate with a base station, wh
    11·1 answer
  • Please help me ASAP! Here is the question.
    15·1 answer
  • 1.An algorithm used to find a value in an array is called a ______________.
    7·2 answers
  • What is gained by increasing the ritation speed of a disk or cd?​
    9·1 answer
  • 1. Who was the first lady programmer?​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!