subject
Computers and Technology, 23.12.2019 19:31 yuluvk

Using only #include , write a c 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.the function convert_lengths will ask the user if he or she wants to convert lengths from feet/inches to meters/centimeters (input value of 1) or from meters/centimeters to feet/inches (input value of 2). an input value of 0 indicates that the user no longer wants to convert length measurements. based on the user’s input, the convert_lengths function will call a stub function length_to_metric for an input value of 1, a stub function length_to_us for an input value of 2, and return control to the main program for an input value of 0. returning control to the main program simply requires your function to return. you should not ever call the function main from your program. the convert_lengths function continues to prompt the user for input until he or she correctly enters a value of 0, 1, or 2. the new stub functions should simply indicate the user’s choice by printing an appropriate message. the function convert_weights will ask the user if he or she wants to convert weights from pounds/ounces to kilograms/grams (input value of 1) or from kilograms/grams to pounds/ounces. an input value of 0 indicates that the user no longer wants to convert weight measurements. based on the user’s input, the convert_weights function will call a stub function weight_to_metric for an input value of 1, a stub function weight_to_us for an input value of 2, and return control to the main program for an input value of 0. the convert_weights function continues to prompt the user for input until he or she correctly enters a value of 0, 1, or 2. the new stub functions should simply indicate the user’s choice by printing an appropriate message.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
Ais the hardware where the data is actually stored.
Answers: 1
You know the right answer?
Using only #include , write a c program that asks the user if he or she wants to convert values that...
Questions