subject

Write code in "C Language"! Not C++ An Internet Service Provider(ISP) has three different subscription packages for its customers:
Package A: For $15 per month with 50 hours of access provided. Additional hours are $2.00 per hour over 50 hours. Assume usage is recorded in one-hour increments,
Package B: For $20 per month with 100 hours of access provided. Additional hours are $1.50 per hour over 100 hours.
Package C: For $25 per month with 150 hours access is provided. Additional hours are $1.00 per hour over 150 hours
Assume the Billing Cycle is 30 days.
The ISP has contracted us to write the application software for their new Billing System.
Recall that in WEEK 9 we wrote the following Functions to do the tasks:
getPackage
validPackage
getHours
validHours
calculatePkg_A
calculatePkg_B
calculatePkg_C
which we will use to develop the application in Week 10.
For WEEK 10 we need to write an Interactive Console Application using the Functions which you developed in Week 9.
Write a Console Dialog Application in the main() function. You will need to display a menu. The Input processing should only be done using functions: get Package, valid Package, get Hours, valid Hours, and program control constructs. The Calculation Processing should only be done using functions: calculatePkg_A, calculatePkg_B, calculatePkg_C, and program control constructs. For Output Results you should display the Package Selected, Hours of Usage, and the Amount charged for the month.
Demonstrate test cases as described in table:
Test Case - Package - Hours
1 - a - 70
2 - b - 140
3 - c - 220
WEEK 9 CODE & Question reference
An Internet Service Provider(ISP) has three different subscription packages for its customers:
Package A: For $15 per month with 50 hours of access provided. Additional hours are $2.00 per hour over 50 hours. Assume usage is recorded in one-hour increments,
Package B: For $20 per month with 100 hours of access provided. Additional hours are $1.50 per hour over 100 hours.
Package C: For $25 per month with 150 hours access is provided. Additional hours are $1.00 per hour over 150 hours Assume the Billing Cycle is 30 days. The ISP has contracted us to write the application software for their new Billing System.
Write the Function Definitions for the following tasks needed by the ISP Billing System._AcalculatePkg_BcalculatePkg _C

get Package: get value (A, B, C) for selected package from the keyboard.
valid Package: ensure that the value entered is an (A, B,C).
get Hours: get value (0 - 720) for hours of usage from the keyboard.
valid Hours: ensure that the value entered is between 0 and 720.
calculatePkg_A: calculates the monthly charges for internet usage based on hours of usage when Package 'A' is selected.
#include
#include
// get the package information from the user
//
char get_package()(
printf("Enter the package name(A, B, C)\n");
char ch;
// take the input from user
scanf("%c", &ch);
return ch;
)
int valid_package(char package)(
// return 1 when package is valid
// valid package means A , B or C
if( package == 'A' || package == 'B' || package == 'C' )
return 1;
return 0;
)
int get_hours()(
// get the number of hours of internet uses from user
printf("Enter the value for hours(0-720)\n");
int hours ;
scanf("%d", &hours);
return hours;
)
int valid_hours(int hours)(
// validate the number of hours
// if hours is less than 720 return 1
if(hours >= 0 && hours <= 720)(
return 1;
)
return 0;
)
double calculatePgk_A(int hours)(
// calulate the package price of any
// given hour for package A.
// base price is 15$.
// extra 2$ per hours
if(hours > 50)
return 15 + (hours - 50)*2;
else
return 15;
)
double calculatePgk_B(int hours)(
// calulate the package price of any
// given hour for package B
// base price is 20$.
// extra 1.5$ per hours
if(hours > 100)
return 20 + (hours - 100)*1.5;
return 20;
)
double calculatePgk_C(int hours)(
// calulate the package price of any
// given hour for package C
// base price is 25$.
// extra 1$ per hours
if(hours > 150)
return 25 + (hours - 150)*1;
return 25;
)
Write code in "C Language"! Not C++

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
question
Computers and Technology, 24.06.2019 05:00
Who is most likely be your target audience if you create a slide presentation that had yellow background and purple text
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
question
Computers and Technology, 24.06.2019 19:50
How to unblock on chrome book? ?
Answers: 1
You know the right answer?
Write code in "C Language"! Not C++ An Internet Service Provider(ISP) has three different subscript...
Questions
question
English, 20.03.2020 13:03
question
Mathematics, 20.03.2020 13:03
question
Mathematics, 20.03.2020 13:03
Questions on the website: 13722363