Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this assignment you will implement a program called \"call_cost_calculator.cp

ID: 3876934 • Letter: I

Question

In this assignment you will implement a program called "call_cost_calculator.cpp" that calculates the net cost of a call (net_cost), the tax on a call (call_tax) and the total cost of the call (total_cost). The program should accept a cell phone number (cell_num), the number of relay stations(relays), and the length in minutes of the cal (call_length) from a user. Please consider the following

1) The tax rate (in percent) on a call (call_rate) is simply based on the number of relay stations (relays) used tomake the call (0<= relays <=5 then tax_rate = 1% ; 6<= relays <=11 then tax_rate = 3%; 12<= relays <=20 then tax_rate = 5%; 21<= relays <=50 then tax_rate = 8%; relays >50 then tax_rate =12%) .

2) The net cost of a call is calculated by the following formula: net_cost = ( relays / 50.0 * 0.40 * call_length).

3) The tax on a call is calculated by the following formula: call_tax = net_cost * tax_rate / 100 (drop /100 if you converted the rate from a percentage)

4). The total cost of a call (rounded to the nearest hundredth) is calculated by the following formula: total_cost = net_cost + call_tax . All tax and cost calculations should be rounded to the nearest hundredths. Use the following format information to print the variables:

Field Format ======================================

Cell Phone XXXXXXXXX

Number of Relay Stations XXXXXX

Minutes Used XXXXXX

Net Cost XXXXXXX.XX

Call Tax XXXXX.XX

Total Cost of Call XXXXXXX.XX

Explanation / Answer

#include<iostream.h>

#include<string.h>

#include<math.h>

#include<stdio.h>

#include<conio.h>

float round(float x)

{

x/=100;

// The ceil function returns the next greatest integer value , which when multiplied with 100 will give us the nearest //100 .

return ceil(x+0.5)*100;

}

void main()

{

clrscr();

char cell_num[15];

int relays,call_length;

float tax_rate,net_cost,call_tax,total_cost;

cout<<" Enter the cell number : ";

gets(cell_num);

cout<<" Enter the number of relay stations : ";

cin>>relays;

cout<<" Enter the length in minutes of the call : ";

cin>>call_length;

if(relays>=0 && relays<=5)

tax_rate=1;

else if(relays>=6 && relays<=11)

tax_rate=3;

else if(relays>=12 && relays<=20)

tax_rate=5;

else if(relays>=21 && relays<=50)

tax_rate=8;

else if(relays>50)

tax_rate=12;

net_cost = (relays/50.0*0.40*call_length);

call_tax = net_cost*tax_rate/100;

total_cost = net_cost + call_tax;

net_cost = round(net_cost);

call_tax = round(call_tax);

total_cost = round(total_cost);

cout<<" ======================================================";

cout<<" Cell phone "<<cell_num;

cout<<" NUmber of relay stations "<<relays;

cout<<" Minutes Used "<<call_length;

cout<<" Net Cost "<<net_cost;

cout<<" Call Tax "<<call_tax;

cout<<" Total Cost "<<total_cost;

getch();

}