Define the card classes card basiccard and multicard


Object Oriented Design and programming Assignment

The scenario for this semester's assignments is part of a banking system: managing pre-paid credit cards which can be used in both Australia and overseas. These cards can be standard single currency cards (AUD) or multi-currency cards. For example before going overseas a customer can get a multi-currency card that they load with the currencies of the countries they will be traveling to, to avoid the risk of a sudden drop in the value of the Australian dollar while they are travelling. The rules used in this assignment for a MultiCard are a simplified version of real prepaid multi-currency cards.

This subject has two assignments. This is the first one. Both use this scenario. The focus of this assignment is defining and testing the basic classes that will be needed. The focus of the second assignment is creating a GUI that supports user interaction, storage and analytics, that is, supports offline storage in text files and supporting analytics over card transaction data.

Each assignment has two levels: advanced (max mark is 7 out of 7) or standard (max mark is 5 out of 7). An advanced assignment must be ready to be marked in week 4 (assignment 1) and 9 (assignment 2) labs. While a standard assignment can be marked in week 4 or 5 (assignment 1) and week 9 or 10 (assignment 2) labs.

Advanced level assignments have additional requirements beyond the standard version.

The Key Classes: Card and Purchase

There are two kinds of cards: BasicCard and MultiCard. There is one kind of Purchase. A BasicCard maintains a balance of Australian dollars only. A MultiCard can maintain up to 5 currency balances of which one must be Australian dollars (AUD).

Each Card has:

- ID
- name
- list of purchases

BasicCard

- balance (AUD)

MultiCard

- supports up to 5 balances in various currencies (one of which is AUD)

Each Purchase has:

- date (stored as a yyyymmdd string)
- location (country)
- currency
- amount
- description

All cards are loaded with AUD. A multiCard support conversion of the AUD balance (or part thereof) into another currency. All card have a total value (in AUD). For a basic card this is just the balance. For a multiCard this is the sum of the AUD value of each contained currency. All cards support making a purchase in AUD (if there is a sufficient balance) for which there is no fee. MultiCards support making a purchase in other currencies only if there is a sufficient balance for that currency. Basic cards also support making foreign currency purchases, however the currency conversion is done at the time of the purchase (and deducted from the AUD balance). When a purchase is made in a foreign currency, there is a 3.5% fee for basic cards, and 1.0% fee for multi-cards. Again, note that a multi-card purchase will only succeed if there is sufficient foreign currency already in the card.

Code outline

The following provides an outline of the main method, which includes the test code you will need to write.

public class Assignment1

{

static List cards = new ArrayList();

public static void main (String[] args)

{

// Create some cards (basic and multi)

// Load the cards

// Check the total value for all the cards

// Convert some currency for some of the multi-cards

// Check the total value of the cards (should be the same)

// Make purchases in various currencies

// Check the total value of the cards

// Report the total balance for each currency across all cards

// Report the total spent in each country across all cards

// Report a transaction history for a selected customer that

// includes each transaction and their final balance.

// Report a card listing that shows for each card, the number

// of active currencies and the overall value for that card.

}
}

In assignment-1:standard there is no user interaction just batch testing as shown above. The purpose of assignment 1 is to get the various class working. In assignment 2 an actual GUI will be added.

A significant design issue will be how to support the currency conversions. There needs to be a list of currencies such as: AUD, NZD, USD, CND, YEN, etc and their conversion rate (from AUD), for example: AUD -> AUD: 1.0, AUD -> NZD: 1.15, AUD -> USD: 0.75 etc. In this assignment do NOT use a HashMap or similar, just use lists/arrays. You will be required to use a HashMap for this in assignment 2.

Standard Level

Assignment deliverables:

1. Define the purchase class

2. Define the card classes: Card, BasicCard and MultiCard including all needed methods

3. Define the data structures needed to support currency rates

4. Complete the program outline test code.

Your solution will use the netbeans IDE. It will be console based. Your solution will make appropriate use of inheritance.

Advanced Level

The advanced level includes all the requirements of the standard level plus the following feature:

5. Support console based user interaction for each operation: create a card, load a card with AU, convert a card currency, show a card's value, show a card's currency balances (and its total AUD value), show a card's purchases, show the total value of all cards, show the total amount of each currency in all cards, show the total amount spend in each country for a single card, show the total amount spend in each country for all cards.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Define the card classes card basiccard and multicard
Reference No:- TGS02768382

Expected delivery within 24 Hours