Question: The code box below shows a simple C++ program. The program is supposed to convert a given distance measured in inches into a its


The code box below shows a simple C++ program. The program is


supposed to convert a given distance measured in inches into a its


equivalent in yards, feet and inches. For instance, 127 inches = 3

The code box below shows a simple C++ program. The program is supposed to convert a given distance measured in inches into a its equivalent in yards, feet and inches. For instance, 127 inches = 3 yards, 1 foot, and 7 inches. However, the program has a number of both logical and syntax errors that need to be fixed in order to work properly. Find these errors and fix them in order to get a correct output. (Hint: The yard is a unit of length measurement equal to 3 feet or 36 inches.) IMPORTANT NOTE Do not add any cout statements except for the final answer as specified above. Do not add "Enter a number", "the number of digits is" or any similar prompts. Also note that the automatic grader is case-sensitive; so "error" is wrong but "ERROR" is correct. Do not add any unnecessary spaces inside the strings of cout statements "" You may add any libraries needed. 11:43 Not Secure-cpe-pc.ju.edu.jo 1 2 #include 3 using namespace std; 4 5 int main() 668 6 { 7 // int y,F,i; Enter Inches to Convert cin>>1; 9 10 11 y=1/36.0; 12 1%-36.0; 13 f=1/3.0; 14 1%-3.0; 15 16 // After Conversion from 17 inches to feet, yards and inches "; cout < < y 11:43 1/0 Not Secure-cpe-pc.ju.edu.jo Program Input: One number represents a distance in inches Program Output: Three numbers represent the inserted distance as a combination of yards, feet, and inches, respectively. Sample Testcase 0: Input: 50 Output: 112 1 2 #include 3 using namespace std; 4 5 int main() 6 { 7 int y,F,i; 8 Enter Inches to Convert

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 Programming Questions!