Computer Science homework assignment
March 3, 2019
Quantitative Research task
March 3, 2019

Prepare a program that converts centimeters to yards, feet, and inches

Prepare a program that converts centimeters to yards, feet, and inches

short program code
Home
Computer Science homework help
short program code
Write a program that converts centimeters to yards, feet, and inches. There are 2.54 centimeters in an inch. You can solve this problem by doing division, multiplication, addition, and subtraction. Converting a float to an int at the appropriate time will help in solving this problem. When you run the program it should look exactly like this (except possibly for decimal places in the inches): How many centimeters do you want to convert? 127.25 This is 1 yard, 1~foot, 2.098425 inches. This is a modification of the program in exercise 5 of Chap. 1. In this version of it you should print “yard” when there is one yard, and “yards” when there is more than one yard. If there are zero yards then it should not print “yard” or “yards”. The same thing applies to “feet”. Use an if statement to determine the label to print and if the label should be printed at all.

The post Prepare a program that converts centimeters to yards, feet, and inches appeared first on superioressaypapers.

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp