What's new

Reviewer FREE CHEGG UNLOCK

#include <iostream>
#include <cmath>

using namespace std;

int main()
{

int centimeters; //variable to store centimeters total
float inches;
float yards;
float feet;
float decimal;

cout << "Enter total centimeters and press enter "; //prompts user to enter total centimeters

cin >> centimeters; //stores value entered by user

cout <<endl<< centimeters << " centimeters = "; //output the value of centimeters and the equal sign

inches = (centimeters * (0.3937));
inches = ceil(inches);
cout << inches << " inches " <<endl; //output inches

cout<<inches << " inches is: " ;
yards = inches / 36;
decimal= yards-long(yards); // get the decimal part which is later converted to feet
cout << yards-decimal << " yard(s) ";//output yards

feet = (decimal * 3);
decimal= feet-long(feet); // get the decimal part which is later converted to inches
cout << feet-decimal << " feet (foot) "; //output feet

inches=(decimal * 12);
cout << inches << " inch (es) " <<endl<<endl; //output inches

system("pause");
return 0;

}
 
1st Link
1622613440554.png

1622613464024.png

1622613538872.png

1622613567474.png

1622613584055.png


2nd link
1622613608881.png

1622613626001.png
 

Attachments

Back
Top