Jump to content

Prog Project HELP PLLZZZ!!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
saleem_ally

saleem_ally

    Newbie

  • Members
  • Pip
  • 2 posts
An Internet service provider has three different subscription
packages for its customers:

Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.

Package B: For $14.95 per month 20. hours of access are provided. Additional hours are $1.00 per hour.

Package C: For $19.95 per month unlimited access is provided.

Table of the months, days, and hours for each month.

Month Days Hours
January 31 744
February 28 672
29 696 (Leap Year)
March 31 744
April 30 720
May 31 744
June 30 720
July 31 744
August 31 744
September 30 720
October 31 744
November 30 720
December 31 744

REQUIREMENTS:

1. Read customer data from "CustomerFile.txt".
This is a sequential text file with space separated fields.
File Format: CustomerId integer (nnn)
Package char
Hours Used float
BillingDate char (mmddyyyy)

2. Read data into an array of records for processing.

3. Validate data before processing.
An invalid record should not be processed and type of
error should be indicated in a message field.

4. Compute customer's monthly charge for package selected.

5. Compute maximum savings and indicate which package
could have been selected for best savings.

6. Write billing data to "CustomerBill.txt".
This is a sequential text file with space separated fields.
File Format: CustomerId integer
Package char
Hours Used float
BillingDate char (mmddyyyy)
Charge float
Savings float
Message char(20)

Customers files
101 A 7 07262003
102 a 10 07262003
103 a 11 07262003
104 a 12.5 07262003
105 a 13 07262003
106 a 15 07262003
107 a 18 07262003
108 a 20 07262003
109 a 22 07262003
110 a 25 07262003
111 a 30 07262003
201 B 7 07262003
202 b 10 07262003
203 b 11 07262003
204 b 12.5 07262003
205 b 13 07262003
206 b 15 07262003
207 b 18 07262003
208 b 20 07262003
209 b 22 07262003
210 b 25 07262003
211 b 30 07262003
301 C 7 07262003
302 c 10 07262003
303 c 11 07262003
304 c 12.5 07262003
305 c 13 07262003
306 c 15 07262003
307 c 18 07262003
308 c 20 07262003
309 c 22 07262003
310 c 25 07262003
311 c 30 07262003
404 d 32 07162003
405 c 32 07161989
406 c 32 07162021
407 c 32 7162021
408 c 32 11162O12
409 c 32 00312003
410 c 32 13312003
411 c 32 04002003
412 c 32 04312003
413 c 32 03322003
414 c 32 02292003
415 c 32 02302000
416 b 721 06302003
417 b 745 07312003
418 b 673 02282003
419 b 697 02292004

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
What code do you have so far? You can start by putting the customer contents into a file and reading the file in your program as an array. Then cycle through each index in the array to determine which package the customer has. Next, depending on the package, calculate the hours they used for the month and determine the price based on the package chart.

#3
saleem_ally

saleem_ally

    Newbie

  • Members
  • Pip
  • 2 posts
what confuses me is that the dates on the list when i went through them is messed up, and im at home rite now.. left school a while ago and i dont have the prog with me...