CPPForSchool.com: Flow of Control Set 1: Assignment 9
9.
Write a program to calculate the monthly telephone bills as per the following rule:
Minimum Rs. 200 for up to 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
For this program, I was a bit stumped at first. However, once I began to focus on the number of calls and then categorizing by quantity, everything came together accordingly. Below is my source code, output screenshots, and a comparison screenshot of the solution provided by CPPForSchool.
Minimum Rs. 200 for up to 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
For this program, I was a bit stumped at first. However, once I began to focus on the number of calls and then categorizing by quantity, everything came together accordingly. Below is my source code, output screenshots, and a comparison screenshot of the solution provided by CPPForSchool.
Comments
Post a Comment