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, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 22.06.2019 21:50
Answer the following questions regarding your system by using the commands listed in this chapter. for each question, write the command you used to obtain the answer. a. what are the total number of inodes in the root filesystem? how many are currently utilized? how many are available for use? b. what filesystems are currently mounted on your system? c. what filesystems are available to be mounted on your system? d. what filesystems will be automatically mounted at boot time?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 23.06.2019 12:30
How is the brightness of oled of the diaplay is controled
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
Mathematics, 16.10.2019 18:00
question
Mathematics, 16.10.2019 18:00
question
English, 16.10.2019 18:00
Questions on the website: 13722359