a. Write a C++ function (Conversion) that converts between inches and cm OR between kg and pounds based on the user's input. The function has two inputs: Either the scale number in double and a letter that indicates whether the entered value is in Inches ('I') or in Centimeters ('C') OR the weight in double and a letter that indicates whether the entered value is in Kilogram ('K') or pounds ('P'). The function prints to the screen the conversion in the other standard. Hint: use the following equations for conversion: 1 inch = 2.54 cm 1 Kg = 2.2 pounds

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.3: Returning Multiple Value
Problem 2E
icon
Related questions
Question

Required in c++ (do not use arrays or complicated code please) 

 

 

a. Write a C++ function (Conversion) that converts between inches and cm OR between
kg and pounds based on the user's input. The function has two inputs: Either the scale number
in double and a letter that indicates whether the entered value is in Inches ('I') or in Centimeters
('C') OR the weight in double and a letter that indicates whether the entered value is in
Kilogram ('K') or pounds ('P'). The function prints to the screen the conversion in the other
standard. Hint: use the following equations for conversion:
1 inch — 2.54 ст
1 Кg %3D 2.2 роиnds
Transcribed Image Text:a. Write a C++ function (Conversion) that converts between inches and cm OR between kg and pounds based on the user's input. The function has two inputs: Either the scale number in double and a letter that indicates whether the entered value is in Inches ('I') or in Centimeters ('C') OR the weight in double and a letter that indicates whether the entered value is in Kilogram ('K') or pounds ('P'). The function prints to the screen the conversion in the other standard. Hint: use the following equations for conversion: 1 inch — 2.54 ст 1 Кg %3D 2.2 роиnds
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning