(a) Problem Then ABC Bank encourages its customers to hold one of the bank’s own credit cards. The bank operates a “points” scheme where customers receive a certain number of points every time they...

I have attached the assignment brief


(a) Problem Then ABC Bank encourages its customers to hold one of the bank’s own credit cards. The bank operates a “points” scheme where customers receive a certain number of points every time they purchase something using the credit card. These points can then be redeemed for gifts from the bank’s “Gift Catalogue”. A CreditCardPoints object contains the following data/properties: The name of the credit card account holder The date that the account was opened (dd/mm/yyyy format) The account number (7-digit) The totalPoints held on the credit card account and the following methods for the following behaviour: · A method to add new points to the totalPoints of the account – based on the fact that 4 points are awarded for every £1 spent on the card · A method to reduce any points used from the totalPoints of the account · A method to display the name, opening date, account number and totalPoints of the account The code for CreditCardPoints is shown on the next page. class CreditCardPoints {//declare global variables protected String name, date; protected int accountNum, totalPoints; public CreditCardPoints(String name,int accountNum, String date)//Create constructor { this.name = name; this.accountNum = accountNum; this.date = date; this.totalPoints = 0; } public CreditCardPoints()//Create default constructor { this.name = ""; this.accountNum = 0; this.date = ""; this.totalPoints = 0; } public void addPoints(int money) //method to work out points due for a sum of money and add to totalPoints { totalPoints = totalPoints + (money * 4); } public void reducePoints(int pointsUsed) //method to remove a number of points due from totalPoints { if (totalPoints>= pointsUsed) totalPoints = totalPoints - pointsUsed; else System.out.println("Error - not enough points available"); } public void display()//Display method { System.out.println("Name of the credit card holder is" + name); System.out.println("The date the account was opened is " + date); System.out.println("The account number is " + accountNum); System.out.println("Total points on the card is " + totalPoints); } } The ABC Bank has now decided to introduce two types of credit card - a GoldCard account and a PlatinumCard account. The bank needs to make a distinction between the two types of credit card accounts that it offers. For each GoldCard account the bank wants: · to add 8 new points for every £1 spent For each PlatinumCard account the bank wants: · to add 12 new points for every £1 spent · to ensure that the customer redeems a minimum of 500 points at a time. 1. Produce class designs using UML and create two subclasses of CreditCardPoints called GoldCard and PlatinumCard, clearly showing what methods need to be overridden. 2. Design, using pseudocode, and implement an application program that: a) contains a main method to i) declare and create an arrayList that can store 4 instances of GoldCard and PlatinumCard, (at least two objects of each type) ii) open the four accounts and sets appropriate initial data for each of them b) contains a method readTransaction() that i) prompts for and reads in a transactiontype in the form of a single character A(dd), R(edeem) or D(isplay). (Also allow for a, r, or d being entered and build in an error check). ii) if the transactiontype is A or R then it reads in one integer in the range 1-4, (the integer represents a particular credit card account), and a number of points. The amount is either added to (A) or taken away (R) from the total number of points iii) if the transactiontype is D then all details of a specified credit card account are printed Use an appropriate loop to allow transactions to be continually entered until the user wants to finish. 3. Design and use suitable test data to test that all parts of the programs are working. Assessment Criteria Task 1 K2 Understand and apply the key concepts of Object Oriented programming K3 I1 Demonstrate the value of reusable components Use an appropriate technique to design, implement and document solutions to programming problems I2 Demonstrate analysis in problem solving by breaking a complex problem down into smaller problems I3 Demonstrate an ability to organise and understand complex data I4 Make reliable judgements in data analysis and prioritisation of design considerations P1 Assimilate and use basic object oriented concepts P3 T1 Design, create a solution to a problem with reusable components Break a problem down into a set of sub-problems UML diagrams have been correctly developed for the two subclasses, showing relationship with the superclass.(12 marks) The two subclasses GoldCard and PlatinumCard been correctly programmed with a high degree of clarity, suitable constructors created and methods overridden if required. (28 marks) Task 2 I2 Demonstrate analysis in problem solving by breaking a complex problem down into smaller problems I3 Demonstrate an ability to organise and understand complex data I4 Make reliable judgements in data analysis and prioritisation of design considerations P1 Assimilate and use basic object oriented concepts P3 Design, create a solution to a problem with reusable components Pseudocode design of application program(10 marks) A working application program has been written to create and use appropriate instances of the two subclasses, using an arrayList. (27 marks) Program documentation and layout(5 marks) Output clearly presented(5 marks) Task 3 P2 Create and apply appropriate test strategies Testing (10 marks)
Jul 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here