C class Please i need your help guys De writing a program th

C class!
Please i need your help guys!
De writing a program that simulates abiling system foran ISP anternet Service Provider) that provides dedicated intermet for small businesses The program will prompt the user for the current month and year, their current internet package and the number of hours le validate Hours0 function: used for the month. The validateHourso function uses an If statement to determine if the total number of The following represent the packages: hours is correct for the current month. Package A For $1999s perumonth 200 hours of access are provided. Months with 28 days (February have 672 hours Additional hours are $200 per hour, Months with 30 days (April une September, and November) have 720 hours Package B: For $299.95 per month 300 hours of access are provided. Decembe with 31 days (January, March May, July, August October and have 744 hours Additional hours are $100 per hour Package C: For $49995 per month unlimited access is provided. It will return al if the hours is valid, otherwise it will return a 0. have chosen a different package The main function: The calculatePackage0 function: price based The calculatePackageo function uses a switch statement to determine the put your name and the date on the package, to make sure current mon While you are stil in the main0 function, The following isused to determine the total price: Additional Package A: S1999s per month 200 hours of access are provided. play an error messag it is not and allow them to enter in month is va e current month again hours are S200 per hour Package B: S29995 per month 300 hours of access are provided. Additional Next, ask the user whether they want package AB orC You do not have to give the description of each package. yourask for the package ask for the number orhOUG.r hours are $100 per hour. sed for the month, Package C. $4999s per month unlimited access is provided. (Hint: You will need to include the logic to determine the number of extra hours to You will then send the hours and the month to a function called validateHours0. The calculate the additional hours You can do this in your cases) validateHours0 function will determine if the hours are valid based on the month and return a 1 if it is valid and a 0 fit is not valid. Allow the user to continue to input the Your function should then return the total price for the month. number of hours until it validates correctly. Next your main0 function will send the hours and package information to a function. called calculatePackage0 that will return the totalprice. ich will then be displayed. The upgradePackage0 function: nd on the drive in the arde age0 can be y not You wia then send the package information, hours and total price to a function called upgrade Message0. Nothing is returned from this function. stly ask the user if they would like to calculate again and give them the opportunity ID do so until theydecide to stop. YOU ARE ONLY WRITING Two FUNCmONst validateHours O and ackage 0 No MORE, NO LESS! In addition, you will be using the upgradePackage0 function found on the K:

Solution

Program simulating isp(internet service provider)that provides dedicated service for small businesses

# include<iostream>

# include<fstream>

# include<conio.h>

using namespace std;


int main()

{

double consumed_time;

int start_hour, start_min, end_hour, end_min;

double discount_cost=0.00,gross_cost=0.00;

double discount_rate=0.15 ;

int new_hour_start, new_hour_end, start_time, end_time;

int regular_rate = 20;

double promo_rate = 15;

char customer_name[20];

double total_cost=0.00;

char ans=\'Y\';

char month[12];

double date,year;

double consumed_new, amount, change;


ofstream bill;

bill.open(\"Monitoring Record.txt\");

cout<<endl<<endl;

system(\"cls\");
  
cout<<\" Enter date: [mm/dd/yy]\";

cin>>month>>date>>year;

bill<<\"\ Date: \"<<date;

while( ans==\'Y\' || ans==\'y\')

{

cout<<\"\ \ \\tEnter customer\'s name: \";

cin>>customer_name;

bill<<\"\ Customer\'s Name:\"<<customer_name;

cout<<\"\ \\tEnter the start hour in 24 hour \";

cin>>start_hour;

cout<<\"\ \\tIn minutes.: \";

cin>>start_min;

cout<<\"\ \\tEnter the end hour in 24 hour \";

cin>>end_hour;

cout<<\"\ \\tIn minutes.: \";

cin>>end_min;

new_hour_start = start_hour * 60;

start_time =start_min + new_hour_start;

new_hour_end = end_hour * 60;

end_time = end_min + new_hour_end;

consumed_time = (end_time - start_time);

consumed_new = consumed_time / 60;

bill<<\"\ You used :\"<< consumed_new<<\"hours\";



if(start_hour<=8 || start_hour==12 || end_hour<=12)

{

gross_cost = (consumed_time * promo_rate)/60;

cout<<\"\ \\tYour gross cost is: \"<<gross_cost<<endl;


}


else if(start_hour>=13 && end_hour<=22)

{

gross_cost = (consumed_time * regular_rate)/60;

cout<<\"\ \\tYour gross cost is: \"<<gross_cost<<endl;

if(consumed_time>=180)

{

discount_cost = gross_cost * discount_rate;

cout<<\"\ \\tYour discount is: \"<<discount_cost<<endl;


}

else if(consumed_time <180)

{

discount_cost = 0;

cout<<\"\ \\tYou have no discount!\" <<endl;



}

else

cout<<\"\ \\tInvalid input\";

}



else

cout<<\"\ \\tInvalid input.\";


bill<<\"\ Sub-total is :\" <<gross_cost;

bill<<\"\ Discount : \"<<discount_cost;

total_cost = gross_cost - discount_cost;

cout<<\"\ \\tYour total bill is : \"<<total_cost<<endl;
bill<<\"\ Total bill is : \"<<total_cost<<endl;

cout<<\"\ \\tEnter amount: \";

cin>>amount;

malou:

if(amount<=total_cost)
{
cout<<\"\ \\tInvalid Amount \"<<endl;

cout<<\"\ \\tEnter amount: \";

cin>>amount;

goto malou;
}

else if (amount>=total_cost)
{

change = amount - total_cost;
cout<<\"\ \\tYour change is : \"<<change<<endl;
}
else
cout<<\"Invalid input..\";

bill<<\"Amount : \"<<amount<<endl;

bill<<\" _______________\"<<endl;

bill<<\"Your change is : \"<<change<<endl;
cout<<endl;


cin>>ans;


cout<<endl;

bill<<\"\\t\\t\\t***************************\"<<endl;

}/*end while */


bill.close();


return 0;
}

C class! Please i need your help guys! De writing a program that simulates abiling system foran ISP anternet Service Provider) that provides dedicated intermet
C class! Please i need your help guys! De writing a program that simulates abiling system foran ISP anternet Service Provider) that provides dedicated intermet
C class! Please i need your help guys! De writing a program that simulates abiling system foran ISP anternet Service Provider) that provides dedicated intermet
C class! Please i need your help guys! De writing a program that simulates abiling system foran ISP anternet Service Provider) that provides dedicated intermet

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site