A program that asks the user if he or she wants to convert values that are lengths or weights. If the user chooses lengths, the program calls a stub function convert_lengths that simply indicates the user’s choice. If the user chooses weights, the program calls a stub function convert_weights that simply indicates the user’s choice. Use the value 1 to indicate lengths and the value 2 to indicate weights. If the user enters 0, terminate the program. The program should continue to prompt the user for input until he or she correctly enters a value of 0, 1, or 2. In addition, the program should allow the user to call convert_lengths or convert_weights as many times as desired (i.e., until a value of 0 is input, indicating that the user is finished). Notice that this style of loop does not require you to ask the user if they want to continue but instead assumes they want to continue until they select 0.
Get Free Quote!
259 Experts Online