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, 21.06.2019 22:00
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
You know the right answer?
Write code in "C Language"! Not C++ An Internet Service Provider(ISP) has three different subscript...
Questions
question
Mathematics, 19.10.2021 14:00
Questions on the website: 13722363