Question 2 (30%) Write your code in Q2() that first asks the user to enter integers (assume the inputs are all positive)

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Question 2 (30%) Write your code in Q2() that first asks the user to enter integers (assume the inputs are all positive)

Post by answerhappygod »

Question 2 30 Write Your Code In Q2 That First Asks The User To Enter Integers Assume The Inputs Are All Positive 1
Question 2 30 Write Your Code In Q2 That First Asks The User To Enter Integers Assume The Inputs Are All Positive 1 (193.67 KiB) Viewed 33 times
Please help me do this 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply