A school with 600 students wants to produce some information from the results ofthe four standard tests in Maths, Science, English and IT. Each test is out of 100 marks. The information output should be the highest, lowest and average mark for each test and the highest, lowest and average mark overall. All the marks need to
be input.
Answers
Answer:
please mark me as brainlist then i will also mark you brainlist
Answer:
Here's some sample code in Python to achieve this:
# Create four arrays to store the marks of each test
maths_marks = []
science_marks = []
english_marks = []
it_marks = []
# Prompt the user to input the marks of each student for each test
for i in range(600):
maths_marks.append(int(input(f"Enter Maths mark for student {i+1}: ")))
science_marks.append(int(input(f"Enter Science mark for student {i+1}: ")))
english_marks.append(int(input(f"Enter English mark for student {i+1}: ")))
it_marks.append(int(input(f"Enter IT mark for student {i+1}: ")))
# Calculate highest, lowest, and average marks for each test
maths_max = max(maths_marks)
maths_min = min(maths_marks)
maths_avg = sum(maths_marks) / len(maths_marks)
science_max = max(science_marks)
science_min = min(science_marks)
science_avg = sum(science_marks) / len(science_marks)
english_max = max(english_marks)
english_min = min(english_marks)
english_avg = sum(english_marks) / len(english_marks)
it_max = max(it_marks)
it_min = min(it_marks)
it_avg = sum(it_marks) / len(it_marks)
# Calculate overall highest, lowest, and average marks
overall_max = max(max(maths_marks), max(science_marks), max(english_marks), max(it_marks))
overall_min = min(min(maths_marks), min(science_marks), min(english_marks), min(it_marks))
overall_avg = (sum(maths_marks) + sum(science_marks) + sum(english_marks) + sum(it_marks)) / (4*len(maths_marks))
# Print the results
print(f"Highest Maths mark: {maths_max}")
print(f"Lowest Maths mark: {maths_min}")
print(f"Average Maths mark: {maths_avg}")
print(f"Highest Science mark: {science_max}")
print(f"Lowest Science mark: {science_min}")
print(f"Average Science mark: {science_avg}")
print(f"Highest English mark: {english_max}")
print(f"Lowest English mark: {english_min}")
print(f"Average English mark: {english_avg}")
print(f"Highest IT mark: {it_max}")
print(f"Lowest IT mark: {it_min}")
print(f"Average IT mark: {it_avg}")
print(f"Highest overall mark: {overall_max}")
print(f"Lowest overall mark: {overall_min}")
print(f"Average overall mark: {overall_avg}")
Explanation:
To produce the required information, the following steps can be taken:
- Create four arrays (one for each test) to store the marks of each student.
- Prompt the user to input the marks of each student for each test and store them in the respective arrays.
- Calculate the highest, lowest, and average marks for each test by iterating over the array and keeping track of the highest, lowest, and sum of marks for each test.
- Calculate the overall highest, lowest, and average marks by iterating over all the arrays and keeping track of the highest, lowest, and sum of all marks.
- Print the results for each test and the overall results.
To learn more about Python from the link below
https://brainly.in/question/16086632
To learn more about array from the link below
https://brainly.in/question/98722
#SPJ2