subject

John has decided to lose weight as a part of his New Year’s resolution. John works out every weekday. However, on weekends he can’t resist his cravings for fast food and binges at the local burger place. John loses 10 ounces for every work-out session on weekdays, but then gains 8 ounces each on Saturday and Sunday. John returns to his resolution on Monday and hits the gym. Can you help John in calculating the number of days required to reach his goal? Write the function days_for_target(), which accepts the following arguments: • initial_weight: a positive integer that represents John’s weight in ounces at the beginning • target_weight: a positive integer that represents John’s target weight in ounces We will assume that John starts working on his New Year’s resolution on a Monday, and that his target weight is less than his current weight. If John loses a little more weight than desired, then this is acceptable. For example, if the current day is a weekday, John currently weighs 2901 and has a target of 2900, then he would work out once more to reach 2801. The function will return 2801. Hint: treat Monday as day 0, Tuesday as day 1, ..., and Sunday as day 6. This pattern repeats every week, so the remainder operator can help you decide whether the current day is a weekday or a weekend day.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:20
Sometimes writers elaborate on the truth when recalling past events so they can enhance their narrative essay with more interesting descriptions. do you feel that published writers should or should not embellish real life events just to make their stories more interesting?
Answers: 2
question
Computers and Technology, 22.06.2019 01:00
How can a broadcast station be received through cable and satellite systems?
Answers: 1
question
Computers and Technology, 22.06.2019 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
You know the right answer?
John has decided to lose weight as a part of his New Year’s resolution. John works out every weekday...
Questions
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Social Studies, 11.09.2020 09:01
question
English, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Biology, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
English, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
English, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
question
Mathematics, 11.09.2020 09:01
Questions on the website: 13722367