Write a program that does the following: Reads an integer from the user that represents the number of the students in a class. Reads the scores of the students from the user and stores them in an array. Calculates and prints the average of the students with a passing grade (above or equal to 60). Hints: Assume that the scores of the students are integers between 0 and 100 (inclusive) Assume that there is at least one student in the class with a passing grade. Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
Write a program that does the following:
Reads an integer from the user that represents the number of the students in a class.
Reads the scores of the students from the user and stores them in an array.
Calculates and prints the average of the students with a passing grade (above or equal to 60).
Hints:
Assume that the scores of the students are integers between 0 and 100 (inclusive)
Assume that there is at least one student in the class with a passing grade.
Sample run 1:
Enter the number of students in the class: 3
Enter the scores of 3 students: 90 80 40
The average of the students with a passing grade is 85.0
Sample run 2:
Enter the number of students in the class: 5
Enter the scores of 5 students: 90 80 40 60 70
The average of the students with a passing grade is 75.0
Transcribed Image Text:Write a program that does the following: Reads an integer from the user that represents the number of the students in a class. Reads the scores of the students from the user and stores them in an array. Calculates and prints the average of the students with a passing grade (above or equal to 60). Hints: Assume that the scores of the students are integers between 0 and 100 (inclusive) Assume that there is at least one student in the class with a passing grade. Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
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