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 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
question
Computers and Technology, 23.06.2019 15:20
An ou structure in your domain has one ou per department, and all the computer and user accounts are in their respective ous. you have configured several gpos defining computer and user policies and linked the gpos to the domain. a group of managers in the marketing department need different policies that differ from those of the rest of the marketing department users and computers, but you don't want to change the top-level ou structure. which of the following gpo processing features are you most likely to use? a, block inheritance b, gpo enforcement c, wmi filtering d, loopback processing
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
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, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
Mathematics, 18.03.2021 02:10
question
Chemistry, 18.03.2021 02:10
question
Biology, 18.03.2021 02:10