A machine’s engine coil rotates in a 360o motion ten times every second once the machine is in operation. Nebisko Biscuits starts its production at 10:00 am and ends at 4:00 pm (6 hours) each day. The company packages one biscuit every 5 seconds. A report of the total biscuits packaged per day is given to the production manager for their weekly report. The machine encountered a fault yesterday and had stopped working for 35 minutes. Implement a C++ program to compute and output the total of times the coil is expected to rotate during normal period of production; as well as compute and output with the total amount of biscuits that is expected to be packaged daily. Your solution must also compute and output the total amount of biscuits that would have been packaged based on the duration for which the machine encountered a fault yesterday.
#include <iostream>
using namespace std;
int main()
{
const int NUMBER_ROTATES_360_EVERY_SECOND=10;
const int START_TIME=10;
const int END_TIME=16;
const int SECONDS_IN_HOUR=3600;
const int NUMBER_PACKAGES_EVERY_SECOND=5;
const int STOP_MINUTES=35;
//compute and output the total of times the coil is expected to rotate during normal period of production;
//Nebisko Biscuits starts its production at 10:00 am and ends at 4:00 pm (6 hours) each day.
int totalTimesCoilRotate=NUMBER_ROTATES_360_EVERY_SECOND*(END_TIME-START_TIME)*SECONDS_IN_HOUR;
cout<<"The total of times the coil is expected to rotate during normal period of production: "<<totalTimesCoilRotate<<"\n";
//compute and output with the total amount of biscuits that is expected to be packaged daily.
//The company packages one biscuit every 5 seconds.
int totalAmountBiscuits=totalTimesCoilRotate/NUMBER_PACKAGES_EVERY_SECOND/NUMBER_ROTATES_360_EVERY_SECOND;
cout<<"The total amount of biscuits that is expected to be packaged daily: "<<totalAmountBiscuits<<"\n";
//compute and output the total amount of biscuits that would have been packaged based on the duration for which the machine encountered a fault yesterday.
int totalAmountBiscuitsFault=((STOP_MINUTES*60)/NUMBER_PACKAGES_EVERY_SECOND);
cout<<"The total amount of biscuits that would have been packaged based on the duration for which the machine encountered a fault yesterday: "<<totalAmountBiscuitsFault<<"\n";
return 0;
}
Comments
Leave a comment