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.

We will do the project over the next two weeks:

WEEK 9 -- Write the Functions to do the tasks that we will be using
to develop the application in Week 10.
WEEK 10 -- Write an Interactive Console Application using the
Functions which you developed in Week 9.

===========================================================================
DESCRIPTION of PROBLEM SET for Week 9
===========================================================================

Write the Function Definitions for the following tasks needed by
the ISP Billing System.

getPackage
validPackage
getHours
validHours
calculatePkg_A
calculatePkg_B
calculatePkg_C
---------------------------------------------------------------------------
getPackage: get value (A, B, C) for selected package from the keyboard.

validPackage: ensure that the value entered is an (A,B,C).

getHours: get value (0 - 720) for hours of usage from the keyboard.

validHours: 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.

Respuesta :

Use the knowledge of computational language in C code to write a code that has three different subscription packages for its customers.

How to write code about sales?

To make it simpler the code is described as:

#include <iostream>

#include <string>

using namespace std;

int main() {

string package;

float time;

float price;

cout << "Choose package: ";

cin >> package;

// Package validation

if ((package == "A") || (package == "B") || (package == "C")) {

cout << "The number of hours: ";

cin >> time;

// Time validation

if (time <= 744) {

// Package A

if (package == "A") {

if (time > 50) {

price = 15 + (time - 50) * 2;

} else {

price = 15;

}

// Package B

} else if (package == "B") {

if (time > 100) {

price = 20 + (time - 100) * 1.5;

} else {

price = 20;

}

// Package C

} else if (package == "C") {

if (time > 150) {

price = 25 + (time - 150) * 1;

} else {

price = 25;

}

cout << "Price: $" << price;

}

See more about C code at brainly.com/question/19705654

Ver imagen lhmarianateixeira