Question: USING PYTHON Constraint: DO NOT use arrays/lists even if you know how to use them Format all decimal values to 2 digits after the decimal

USING PYTHONUSING PYTHON Constraint: DO NOT use arrays/lists even if you know howto use them Format all decimal values to 2 digits after thedecimal point Process: Write a program to process the age in years

Constraint: DO NOT use arrays/lists even if you know how to use them Format all decimal values to 2 digits after the decimal point Process: Write a program to process the age in years of a set of students. i. Ask the user for the number of students. Validate the input so that the input number is a positive number. If the number of students is not positive, allow the user to enter another number. Repeat to make sure a valid number has been entered for the number of students. For each student, ask the user for the student's age in years. Do not allow the user to enter an invalid age (a number less than 1 or more than 120 is invalid). Issue an error message and allow the user to enter a valid age. ii. iii. iv. V. vi. vii. viii. ix. X. xi. Calculate and display the total age of all students in years. Find and display the lowest age value in years. Find and display the highest age value in years. Find and display the number of students whose age is even. Find and display the number of students whose age is odd. Find and display the average of all even age values. Find and display the average of all odd age values. Calculate and display the average age for all students in years Calculate and display the average age for all students in days. Assume 365 days in a year. Here is sample test case: Enter the number of students: -1 Invalid try again Enter the number of students: -5 Invalid try again Enter the number of students: 3 Enter the age of the student: 20. Invalid try again Enter the age of the student: 30 Enter the age of the student: 15 Total age in years = 65 Lowest age in years = 15 Highest age in years = 30 Number of students with even age values = 2 Number of students with odd age values = 1 Average of all even age values = 25.00 Average of all odd age values = 15.00 Average age in years = 21.67 Average age in days = 7908.33

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 Databases Questions!