The problems is -- Write a program which converts inches into feet and inches by using loop(s) (while/do-while/for statement(s)). Do NOT use division (/) or mod (%) operations. Receive user's input (original inches) from keyboard.
You can terminate the program after one session. If you work more so that the program repeats the session until the user signals with -1, you will receive a 1 point EXTRA CREDIT --
The output is supposed to look like this -- WELCOME TO THE INCH CONVERTER! --
Enter the original inches: 71
** Equivalent feet/inches: 5 feet, 11 inches **
----- THANK YOU. GOOD BYE! -----
This is my code so far
#include <iostream>
using namespace std;
int main()
{
cout << "----- WELCOME TO THE INCH CONVERTER! ----- " << endl;
int inches;
cout << "Enter the original inches: ";
cin >> inches;
int counter;
counter = 0;
while (counter < 12)
{
if (inches >= 12)
inches = inches - 12;
//counter ++;
counter = counter + 2;
}
cout << "** Equivalent feet/inches: " << foot << ", " << inches << endl;
cout << "----- THANK YOU. GOOD BYE! ----- " <<endl;
//End of the program
system("pause");
return 0;
}
I am able to display the inches right but for some reason i cant get the feet displayed. Thanks any help would be appreciated.

New Topic/Question
Reply




MultiQuote





|