Regis University CC&IS
CS210 Introduction to Programming
Java Programming Assignment 7: Arrays
Problem Summary
Suppose the non-profit group, who you wrote the Charity Event Tracker from Java programming assignment 6 for, wanted to make some changes. They now want to keep track of individual donations, so they can analyze them further, which means all donations will be stored in an array. They also want to include all data in the file (no user input).
Each line of the data file will still contain an identifier and a number.
T = number of tickets sold
D = donations
E = expenses
The number following the D and E identifiers will still be dollar and cents amounts. But the number following the T identifier will now be an integer number of tickets sold.
Sample data file lines would be:
T 25
E 210.99
T 1
D 500.00
E 134.67
Program Requirements
1) Modify the Event class as follows:
a) Modify the private data properties in the Event class.
 Add a static constant to hold the maximum number of donations the array can hold (200).
 Instead of a donation total property, create a donation array (that can hold up to 200 individual donation amounts).
 Add a number of donations property to keep track of the number of donation amounts stored in the array.
 Instead of a total ticket sale income property, create two separate properties:
o the single ticket price
o the total number of tickets sold.
 The expenses property will still hold the total of all expenses for an event.
b) Replace the constructor in the Event class to be a constructor with
 a parameter for the ticket price, used to initialize the single ticket price property
All other properties should be initialized to 0.

    • 8 years ago
    QUALITY WORK
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      netbeansprojects1.zip