Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CPT-236

Programming Assignment Class Name: YardToFeet


Write a Java program that asks the user to enter some number of yards. The program will then print out the number of yards entered, in order to confirm the users input. Then it will output the equivalent number of feet, and finally the number of inches that the number of yards converts to. Of course, there are 3 feet per yard, and 12 inches per foot. Consider the following points: Provide a comment block that includes your name, date, and program description. Choose meaningful identifiers for all variables and constants Use blank lines here and there to separate logical steps in your code Use a one-line comment before each block to describe what you are doing dont describe the code syntax, but rather the purpose of the code. These comments should effectively describe the steps in your algorithm. Spell things carefully, including capitalization remember Java is case sensitive. Indent things carefully, as in the sample program Check your results!

Sample run of the program: Enter some number of yards: 5 You entered 5 yards. This is equivalent to 15 feet or 180 inches. Another sample run: Enter some number of yards: 6 You entered 6 yards. This is equivalent to 18 feet or 216 inches.

You might also like