Question: Python Programming 19. [20 points] Write a program that accepts a non-negative integer street number N and prints the street number with the closest bus

Python Programming

Python Programming 19. [20 points] Write a program that accepts a non-negative

19. [20 points] Write a program that accepts a non-negative integer street number N and prints the street number with the closest bus stop. Stops are regularly spaced every 7 streets, starting from 0th [sic] Street for simplicity. In other words, the beginning of the bus stop map looks like this: 0 1 2 3 45 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 For example, if the input is N 9 then your program should output 7, whereas if the input is N 11 then your program should output 14, and so on. There is no limit on how large N could be. [ Hint: You should need at most a conditional-although the answer can also be expressed as just a single arithmetic expression (you don't have to do it that way)

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!