Question-   write a program that calculates and prints the bill for a cellular telephone company

Solution-

Question: When outputting the number of minutes the telephone service was used, output the day time and night time minutes used for a Premium type of service.
Be sure to format your output appropriately (e.g. use dollar signs and round cents to 2 decimal places).
TIP: Utilize a switch to implement your solution.
Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Its rates vary, depending on the type of service. The rates are computed as follows:

Regular service: \$10.00 plus first 50 minutes are free. Charges for over 50 minutes are \$0.20 per minute.

a. For calls made from 6:00 a.m. to 6:00 p.m., the first 75 minutes are free; charges for more than 75 minutes are \$0.10 per minute.
b. For calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges more than 100 minutes are \$0.05 per minute.

Complete solution below:

``````

#include <stdio.h>

#include <iostream>

#include <stdlib.h>

#include <cstdlib>

using namespace std;

//Money clss are here:

class Moneycls

{

private:

//variable for dollars

int dollar;

//variable for cents

int cent;

public:

Moneycls(int dol, int cen)

{

dollar = dol; cent = cen;

}

void AddDollar(int _dollar) {dollar += _dollar;}

{

cent += _cent;

while(cent > 99)

{

cent -= 100; ++dollar;

}

}

void DisplayMoney()

{

cout<<"--> \$"<<dollar<<"."<<cent;

}

};

//Here is main function:

int main()

{

Moneycls mone(0, 0);

int service;

cout<<"* what is Service do you use? "<<endl;

cout<<"1-->Choise for Regular service "<<endl;

cin>>service;

switch(service)

{

case 1:

{

int minutes = 0;

cout<<"Hello \n Enter the number of minutes: ";

cin>>minutes;

if (minutes > 50)

{

minutes -= 50;

}

cout<<"* \n Bill Payment Services is := ";

mone.DisplayMoney();

cout<<endl;

} break;

case 2:

{

int minutes1;

int minutes2;

cout<<" Enter the Number of Minutes (use from 6:00 a.m. to 6:00 p.m):= ";

cin>>minutes1;

cout<<" Enter the Number of Minutes (use from 6:00 p.m. to 6:00 a.m):= ";

cin>>minutes2;

if (minutes1 > 75)

{

minutes1 -= 75;

}

if (minutes2 > 100)

{

minutes2 -= 100;

}

cout<<"Bill Payment Services is := ";

mone.DisplayMoney();

cout<<endl;

}; break;

default: cout<<"Error. \n Wrong input!!! \n Please Enter correct value."<<endl;

}

system("pause");

return 0;

}
```
```

Our happy customers

They are fast in responding to homework questions. they have the best technical writers. Thanks for helping me with my programming doubts.

Dyana
5

I contact to disklib for homework, they help me out, despite there was some technical issue they gone through extra mile for me and provide me good quality work in first priority. 100% recommended.

Asif Waheed
5

Desklib's study resources are best & unique. Their study database is easy to access and easy to use.
100 % recommended.

Mike Taylor
5