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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:40, malibu777
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
image
Computers and Technology, 22.06.2019 21:30, sunshinekisses
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, GamerGirl15
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
image
Computers and Technology, 23.06.2019 08:00, seaotter7140
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
You know the right answer?
Write code in "C Language"! Not C++ An Internet Service Provider(ISP) has three different subscript...

Questions in other subjects:

Konu
English, 07.10.2019 18:50