Question: Task 4: Unit Converter Write a program that will be able to handle unit conversion, as follows: - The program will ask the user what

 Task 4: Unit Converter Write a program that will be able

Task 4: Unit Converter Write a program that will be able to handle unit conversion, as follows: - The program will ask the user what they want to convert: 1) temperature or 2) speed. - If the user enters 1 (for temperature conversion): - Ask them to enter the temperature (number) they want to convert Ask them to enter the current unit used for the temperature: 'C' Celsius or 'F' Fahrenheit - If the user enters 2 (for speed conversion): Ask them the same questions as for temperature conversion. The units to use for speed are 'KMH' (for "kilometer per hour') or - Have the program conver hour). F. or F to C. Kurn convert the temperature length provided from the current unit as indicated by the user to the opposite one( C to - Display result of to MPH, or MPH to KMH ) - The program of conversion to the user. Use substitution (format) method) for the output. Drofine needs to make use of functions, as follows. Define a function that handles temperature conversion, both from C to F, and F to C. The function is to accept 2 parameters: temperature and the current unit for the temperature (C or F). The retum value of the function should be a number representing the converted temperature value. Define another function, for speed conversion. Follow the same design (re: parameters and return value) as with the first function. - The flow of the program is to be controlled from the main section (i.e. outside the functions), meaning that the input from the user is collected by the code outside functions, and then passed as arguments to the respective function, based on user selection of conversion type. - The program will trim any extra spaces that are entered before or after any input coming from user, and ignore any letter-case differences in all of the user input (e.g. "C". " F", " " "C". "KMH", "MPH", "mph" or "kmh" etc. are all valid values) - Ensure that all messages to the user (prompts, final output) are professionally written (easy to understand, with complete info. consistent in format, with no grammar errors). Document your program as discussed in class (add program header comments function header comments, and inline comments as needed). Follow the variable naming conventions and good coding practices. we've discussed in class

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!