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, 22.06.2019 06:00
Write a function that draws a pool ball. this function should take as parameters, the color, the number that should go on the pool ball, and the location of the center of the pool ball. the radius of the pool balls should be pool_ball_radius, and the font of the number should be pool_ball_font. the text of the pool ball font should be white. drawpoolball(color.orange, 5, 100, 100); drawpoolball(color.green, 6, 50, 200); drawpoolball(color.red, 3, 150, 350); drawpoolball(color.blue, 2, 250, 140); to center the numbers on the pool ball, you should use the getwidth() and getheight() methods. you are allowed to call these methods on your text object, such as txt.
Answers: 3
question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
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
question
Mathematics, 31.03.2021 21:00
question
Mathematics, 31.03.2021 21:00
question
Mathematics, 31.03.2021 21:00
Questions on the website: 13722363