Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab Assignment For today's practice we are going to get practice writing functions. Specially we are going to write a program to do a handful
Lab Assignment For today's practice we are going to get practice writing functions. Specially we are going to write a program to do a handful of time conversions You will need to write six functions to do conversions. Each of these functions should take 1 parameter the number of days and return the converted result: days2years: 1 year 365.25 days days2weeks: 1 week-7 days days2hours: 24 hours 1 day days2minutes: 60 minutes 1 hour days2seconds: 60 seconds 1 minute days2milliseconds: 1000 milliseconds-1 second Notice some of these functions will need to call each other as they are not all in terms of days. You will also need to write two other functions. print_conversions: This function should call the six functions above in the order listed and print out the results followed by a space and the unit name main: This function use the input statement to get number of days from the user then call the print_conversions function Example When given the input 1 The output should exactly match days? 0.0027378507871321013 years 0.14285714285714285 weeks 24.0 hours 1440.0 minutes 86400.0 seconds 86400000.0 milliseconds Load derauit template... 1 ## Write 6 functions for conversion 3 ##Write print-conversions 4 5 # Write main 7 # Make sure main gets called first 8 ifname "_main_" main) 9 mainD
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started