Question: 5. Write a program that finds the average number of hours per day that a given student studies programming as well as chemistry. For each

 5. Write a program that finds the average number of hours

5. Write a program that finds the average number of hours per day that a given student studies programming as well as chemistry. For each given student include two prompts, one for each subject. Have the program print out which subject the student, on average, spent the most time on. This program will find the average number of hours a day each given student spent on programming and on chemistry over a long weekend How many students are there? 3 Enter the number of days in the long weekend: 2 Enter student 1 day 1 programming hrs: 3 Enter student 1 day 1 chemistry hrs: 2 Enter student 1 day 2 programming hrs: 2 Enter student 1 day 2 chemistry hrs: 1 The average number of hours per day spent programming by student 1 is 2.5 The average number of hours per day spent chemistry by student 1 is 1.5 This student averaged more time on programming. Enter student 2 day 1 programming hrs: 1 Enter student 2 day 1 chemistry hrs: 2 Enter student 2 day 2 programming hrs: 1 Enter student 2 day 2 chemistry hrs: 3 The average number of hours per day spent programming by student 2 is 1.0 The average number of hours per day spent chemistry by student 2 is 2.5 This student averaged more time on chemistry. Enter student 3 day 1 programming hrs: 1 Enter student 3 day 1 chemistry hrs: 1 Enter student 3 day 2 programming hrs: 1 Enter student 3 day 2 chemistry hrs: 1 The average number of hours per day spent programming by student 3 is 1.0 The average number of hours per day spent chemistry by student 3 is 1.0 This student spent the same amount of time on both subjects. Note that the inner loop of this program is executed n times-once for each day of the long weekend. Here, n is a positive integer input by the user. In other words, the user decides how many days to consider just as they choose how many students to consider

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!