An ordinary colored printer can print 12 pages per minute. Make a program that will input number of pages, and compute the time to complete the print out. Consider the minutes and hour of your display. Your program will terminate if you input zero in the number of pages.
(minutes =no.pages/12)
Ex: Input pages: 720
Minutes = 60
Hour = 1
#include<iostream>
using namespace std;
int main()
{
const int PgPerMin=12;
const int PgPerHour=12*60;
int numPg;
cout<<"Please, enter a number of pages to print, 0 - quit:";
while(cin>>numPg)
{
if(numPg==0)break;
cout<<"Minutes = "<<numPg/PgPerMin<<"\n";
cout<<"Hour = "<<numPg/PgPerHour<<"\n";
cout<<"Please, enter a number of pages to print, 0 - quit:";
}
}
Comments
Leave a comment