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 02:00
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Me and category do i put them in because this is science
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
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
Questions on the website: 13722367