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, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
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
History, 04.02.2020 00:08
Questions on the website: 13722363