Question: Assignment #2 Write a program that takes length as input in feet and inches. The program should then convert the lengths in centimeters and display

 Assignment #2 Write a program that takes length as input in

Assignment #2 Write a program that takes length as input in feet and inches. The program should then convert the lengths in centimeters and display it on screen. Assume that the given lengths in feet and inches are integers. Based on the problem, you need to design an algorithm as follows: 1. Get the length in feet and inches. 2. Convert the length into total inches. 3. Convert total inches into centimeters. 4. Output centimeters To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Instead of using the value 2.54 directly in the program, you will declare this value as a named constant. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches. Instead of using 12 directly in the program, you will also declare this value as a named constant. Using a named constant makes it easier to modify the program later. To write the complete length conversion program, follow these steps: 1. Begin the program with comments for documentation. 2. Include header files, if any are used in the program. 3. Declare named constants, if any. 4. Write the definition of the function main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!