143k views
5 votes
1.9 Write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as well as the number of boxes needed to yield one metric ton of cereal. In: A metric ton is 35,273.92 ounces.

User Yerin
by
3.4k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

//Header file section

#include<i ostream>

using namespace std;

#define MATRICTON 35273.92

//Begin main function

void main ()

{

//variable declaration

double ounceses,weight,boxes;

char choice;

do

CHOICE == 'y' );

weight = (ounceses/MATRICTON);

//Pause system for a while

system("pause");

}//End main function

Output:

Enter weight of packaged of breakfast cereal in ounce: 2654

weight of packet in metrictons is 0.0752397

Number of boxes to make metric: 13.2909

Press y or Y to continue

Enter weight of packaged of breakfast cereal in ounce: 5642

weight of packet in metrictons is 0.159948

Number of boxes to make metric: 6.25202

Press y or Y to continue

n

press any key to continue . . .

User MYousefi
by
3.9k points