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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education