Answer to Question #326623 in Algorithms for KeKo

Question #326623

A customer pays a monthly fee of $37.50 for the telephone service and $3.50 per minute for long distance calls. Input the number of minutes for long distance calls. Calculate the total bill. Print the results and ask again. The only way to exit the program would be for number of minutes is -1. (while loop structure)


1
Expert's answer
2022-04-10T12:36:28-0400


#include <iostream>


using namespace std;


int main(){
	float totalBill=37.50;
	float minute =0;
	while(minute!=-1){
		cout<<"Enter minutes (-1 exit): ";
		cin>>minute;
		if(minute!=-1){
			totalBill+=3.50*minute;
			cout<<"The total bill: $"<<totalBill<<"\n\n";
		}
	}
	system("pause");
	return 0;
}



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