question, only Odd version is needed, noneed to finish the even version, thx!!! Please also make that theoutputs are correct according to the question's instructions!
Question 2 (30%) Write your code in Q2() that first asks the user to enter integers (assume the inputs are all positive) and when the input is a zero, the program should stop accepting numbers from the user. Then, it finds the maximum among some of the input numbers and calculates the average of them according to your student ID. The average value should be displayed in 2 decimal places (see below). Odd Version (7th digit of your student ID is 1, 3, 5, 7 or 9) The program should find the maximum and the average value among all inputs that are odd numbers. You can assume the user always enters at least one positive odd number. Even Version (7th digit of your student ID is 0, 2, 4, 6 or 8) The program should find the maximum and the average value among all inputs that are even numbers. You can assume the user always enters at least one positive even number. The last input is a zero that should not be considered in the average. Odd Version (odd 7th digit in student ID) Sample display Input: 12 Input: 4 Input: 19 Input: 3 Input: 6 Input: 7 Input: 0 Maximum is 19 Average is 9.67 Even Version (even 7th digit in student ID) Sample display Input: 12 Input: 4 Input: 19 Input: 3 Input: 6 Input: 7 Input: 0 Maximum is 12 Average is 7.33
Please help me do this Question 2 (30%) Write your code in Q2() that first asks the user to enter integers (assume the inputs are all positive)
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am