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 2
[30 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 if-else statement to check if the average grade is greater than or equal to 50. 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 if-else statement to check if the average grade is greater than or equal to 50. If it is, then the program prints that the students passed. Otherwise, the program prints that the students failed.
Question 2 [ 3 0 marks ] You have been tasked to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!