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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 23.06.2019 15:00, herchellann302
To check whether your writing is clear , you can
Answers: 2
image
Computers and Technology, 24.06.2019 11:00, soystersoce
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
image
Computers and Technology, 24.06.2019 15:40, elgallo5399
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
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 in other subjects:

Konu
Chemistry, 20.05.2021 16:40
Konu
English, 20.05.2021 16:40