Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The outer loop controls the number of students. Note that the inner loop of this program is always executed exactly three times, once for each

The outer loop controls the number of students. Note that the inner loop of this program is always executed

exactly three times, once for each day of the long weekend. Modify the code so that the inner loop iterates n times, where n is a positive integer that the user inputs. Thus, the users decide how many days to consider just as they choose how many students to consider. A sample run: This program will find the average number of hours a day that a student spent programming over a long weekend; How many students are there? 2 Enter the number of days in the long weekend 2 Please enter the number of hours worked by student 1 on day 1 4 Please enter the number of hours worked by student 1 on day 2 6 The average number of hours per day spent programming by student 1 is 5 Please enter the number of hours worked by student 2 on day 1 9 Please enter the number of hours worked by student 2 on day 2 13 The average number of hours per day spent programming by student 2 is 11

Modify question3.cpp so that it also finds the average number of hours per day that a given student studies biology as well as programming. For each given student include two prompts, one for each subject. Have the program display which subject the student, on average, spend the most time on.

Step by Step Solution

3.40 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

include include using namespace std int main int students ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
606ad5686302f_48705.pdf

180 KBs PDF File

Word file Icon
606ad5686302f_48705.docx

120 KBs Word File

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Numerical Methods For Engineers

Authors: Steven C. Chapra, Raymond P. Canale

5th Edition

978-0071244299, 0071244298

More Books

Students also viewed these Programming questions