I'm trying to convert someones cereal weight from ounces to metric tons, and how many boxes it would take to make a metric ton. I suck at converting weights and I wanted to know if the logic in my function is correct and is converting the weights like it should be. If it is not correct can someone please tell me the syntax and function to do this. Thank You!
#include <iostream>
using namespace std;
int main ()
{
double Cereal_Weight, Cereal_Total, Total_Boxes;
cout << "Welcome to the cereal converter program\n";
cout << "Enter the weight in ounces of the cereal box\n";
cin >> Cereal_Weight;
Cereal_Total = Cereal_Weight / 35273.92;
Total_Boxes = Cereal_Weight * 35273.92;
cout << "Your cereal weighs " << Cereal_Total << " metric tons\n";
cout << "It would take " << Total_Boxes << " to fill a metric ton\n";
cin.sync();
cin.get();
return 0;
}
#include <iostream>
using namespace std;
int main ()
{
double Cereal_Weight, Cereal_Total, Total_Boxes;
cout << "Welcome to the cereal converter program\n";
cout << "Enter the weight in ounces of the cereal box\n";
cin >> Cereal_Weight;
Cereal_Total = Cereal_Weight / 35273.92;
Total_Boxes = Cereal_Weight * 35273.92;
cout << "Your cereal weighs " << Cereal_Total << " metric tons\n";
cout << "It would take " << Total_Boxes << " to fill a metric ton\n";
cin.sync();
cin.get();
return 0;
}
Comment