Programing in C Write a program that calculates the average grade of a class. 1. You should ask the user how many students you have (you will use this number to set up the length of your array of decimals). 2. Once you have your array, you will have to ask the user for all the grades (there should only be one grade per student). Using a while loop. 3. While you are scanning the grades, you should check if the inputted grade is in the range 0.0 to 10.0 (inclusive). If the grade is not in this range, you should display a message to the user and assign 0.0 to the grade. 4. Once your array is populated with all student's grades, print out the values of the array, so that the user knows these values were saved correctly (use a while loop as well). 5. After this calculate the average (add up all grades and divide by the number of students). Hint: You will need a loop to do so; please use a while loop as well. Example: How many students are in your class? 8 Please input the grades: 8.5 9.8 7.9 10.0 10.2 You should only input grades between 0.0 and 10.0. I am assigning zero to this grade. 9.7 0.0 -0.1 You should only input grades between 0.0 and 10.0. I am assigning zero to this grade. These are the grades in your class: 8.500000 9.800000 7.900000 10.000000 0.000000 9.700000 0.000000 0.000000 The average grade of your class is: 5.74

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter12: Exception Handling
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
100%
Programing in C
Write a program that calculates the average grade of a class.
1. You should ask the user how many students you have (you will use this number to set up the
length of your array of decimals).
2. Once you have your array, you will have to ask the user for all the grades (there should only
be one grade per student). Using a while loop.
3. While you are scanning the grades, you should check if the inputted grade is in the range 0.0
to 10.0 (inclusive). If the grade is not in this range, you should display a message to the user and
assign 0.0 to the grade.
4. Once your array is populated with all student's grades, print out the values of the array, so that
the user knows these values were saved correctly (use a while loop as well).
5. After this calculate the average (add up all grades and divide by the number of students).
Hint: You will need a loop to do so; please use a while loop as well.
Example:
How many students are in your class? 8
Please input the grades:
8.5
9.8
7.9
10.0
10.2
You should only input grades between 0.0 and 10.0. I am assigning zero to this grade.
9.7
0.0
-0.1
You should only input grades between 0.0 and 10.0. I am assigning zero to this grade.
These are the grades in your class:
8.500000
9.800000
7.900000
10.000000
0.000000
9.700000
0.000000
0.000000
The average grade of your class is:
5.74
Transcribed Image Text:Programing in C Write a program that calculates the average grade of a class. 1. You should ask the user how many students you have (you will use this number to set up the length of your array of decimals). 2. Once you have your array, you will have to ask the user for all the grades (there should only be one grade per student). Using a while loop. 3. While you are scanning the grades, you should check if the inputted grade is in the range 0.0 to 10.0 (inclusive). If the grade is not in this range, you should display a message to the user and assign 0.0 to the grade. 4. Once your array is populated with all student's grades, print out the values of the array, so that the user knows these values were saved correctly (use a while loop as well). 5. After this calculate the average (add up all grades and divide by the number of students). Hint: You will need a loop to do so; please use a while loop as well. Example: How many students are in your class? 8 Please input the grades: 8.5 9.8 7.9 10.0 10.2 You should only input grades between 0.0 and 10.0. I am assigning zero to this grade. 9.7 0.0 -0.1 You should only input grades between 0.0 and 10.0. I am assigning zero to this grade. These are the grades in your class: 8.500000 9.800000 7.900000 10.000000 0.000000 9.700000 0.000000 0.000000 The average grade of your class is: 5.74
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning