Answer to Question #263897 in C++ for Kashce

Question #263897

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


1
Expert's answer
2021-11-10T06:34:22-0500
#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:";
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS