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 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesn’t exist
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
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
question
Computers and Technology, 04.03.2021 14:00
Questions on the website: 13722359