Question: Copy and use the following pseudocode for your main function:speed _ in _ miles = get _ valid _ number ( Speed in miles

Copy and use the following pseudocode for your main function:speed_in_miles = get_valid_number("Speed in miles")speed_in_kilometres = convert_miles_to_kilometres(speed_in_miles)fine = determine_fine(amount_over_limit)
Implement that pseudocode in Python, including the function definitions with proper docstrings.
Remember that you've done some of this before, so you can copy your previous work:
Prac 2 where we calculated kmm
Prac 3 where we determined speeding fines
Test this using meaningful test data that you can understand.
Important: The value of the fine as a number type is much better to return than a string, or a whole
message.
What if we wanted to determine a new bank balance after paying the fine?
This is an example of SRP.
It is the determine_fine function's ONLY (single responsibility) job to determine the actual fine as
an actual number.
It is counter-productive for this function to print the fine or to format with a '$' or anything else.
bank_balance -= fine doesn't work if fine is something like Your fine is $199.
insert "you had one job" meme here >
When you have this working, complete a more fulsome program that matches the following example
output:
Sample OutputSpeed limit in km/h: 80
Your speed of }88.7\textrm{km}/\textrm{h}\mathrm{ was over the limit by 8.7 km}/\textrm{h}\mathrm{.
Your fine will be $309.00
Enter your current bank balance: $22.35
Your bank balance after your fine will be }$-286.6
Don't speed again, OK?
Farewell
and
Your speed in miles per hour: 34
Speed limit in km/h: 60
Your speed of }54.7\textrm{km}/\textrm{h}\mathrm{ has not exceeded the speed limit - no fine
Farewe11
 Copy and use the following pseudocode for your main function:speed_in_miles =

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!