Question: Question 2 [ 3 0 marks ] You have been tasked to develop a program that calculates the average grade of a list of students
Question
marks
You have been tasked to develop a program that calculates the average grade of a list of students and outputs the number of students who passed or failed. The program should use an ArrayList class and iterators.
Requirements:
The program must use a for loop to iterate over the list of grades and calculate the sum of all the grades. The program must then use an ifelse statement to check if the average grade is greater than or equal to If it is then the program should print that the students passed. Otherwise, the program should print that the students failed.
This program works by first getting the number of students from the user. Then, it uses a for loop to iterate over the list of students and calculate the sum of all the grades. Finally, it calculates the average grade and prints it to the console. It then uses an ifelse statement to check if the average grade is greater than or equal to If it is then the program prints that the students passed. Otherwise, the program prints that the students failed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
