Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE205 Object Oriented Programming & Data Structures Assignment 01: 100 pts Assignment 01-Inheritance and Polymorphism You may work in pairs (that is, as a group

image text in transcribedimage text in transcribed

CSE205 Object Oriented Programming & Data Structures Assignment 01: 100 pts Assignment 01-Inheritance and Polymorphism You may work in pairs (that is, as a group of two) with a partner on this assignment if you wish, or you may work alone If you work with a partner, only submit one lab project with both of your names in the source code file to Blackboard (BB) for grading; you will each earn the same number of points. What to hand in, and by when, is discussed below Assignment Objectives After completing this assignment the student should be able to Write an abstract base class in Java according to Interface specifications given in UML Implement base class Interfaces in java according to specifications given in UML. Assignment Requirements For this assignment you are given a Java source code file (CSE205_Assignment01.java) with a main method and supporting methods (MAKE NO CHANGES TO THIS FILE). You must write the following Java files to complete the program BankAccount.java CheckingAccount.java SavingsAccount.java CreditcardAccount.java The specifications for these files are given below (including the UML diagram on the following page) Special requirements All Bank Accounts 1. All bank accounts have a balance stored as an amount of pennies -Al transaction amounts are in pennies 2. All debit amounts will be subtracted from the balance, and all credit amounts will be added to the balance 3. All bank accounts have a non-negative interest rate (0.02 would be a 2% interest rate) 4. When applying interest, interest amount is calculated by multiplying the balance by the interest rate 5. When applying interest, interest amount is added to the balance 6. Interest will not be applied to any account with a balance of zero 7. Debit methods will return false if the transaction cannot be made because of insufficient balance or insufficient credit limit. Otherwise they will return true A savings account cannot have a negative balance The getAccoutInfoAsString method will return a string formatted like this: 1. a. The debit method will return false if an attempt to overdraw the account is made 2. Account type Savings Account ID Balance Interest rate0.01 : 101101 : 123.45 Any CheckingAccount debit that ends with a negative balance will incur an overdraftFee (i.e. the overdraftFee amount will be subtracted from the balance) Interest will not be applied to a Checking account with a negative balance The getAccoutInfoAsString method will return a string formatted like this: 1. 2. 3. Account type Checking Account ID Balance Interest rate0.02 Overdraft fee20.00 : 202202 : 2000.00 Creditcard accounts 1. The balance of a Creditcard account cannot overrun its credit limit a. The debit method will return false if an attempt to overdraw the account is made 2. Interest will not be applied to a Creditcard account with a positive balance The getAccoutInfoAsString method will return a string formatted like this: 3. Account type Creditcard Account ID Balance Interest rate0.03 Credit limit 10000.00 : 303303 : -275.50 CSE205 Object Oriented Programming & Data Structures Assignment 01: 100 pts Assignment 01-Inheritance and Polymorphism You may work in pairs (that is, as a group of two) with a partner on this assignment if you wish, or you may work alone If you work with a partner, only submit one lab project with both of your names in the source code file to Blackboard (BB) for grading; you will each earn the same number of points. What to hand in, and by when, is discussed below Assignment Objectives After completing this assignment the student should be able to Write an abstract base class in Java according to Interface specifications given in UML Implement base class Interfaces in java according to specifications given in UML. Assignment Requirements For this assignment you are given a Java source code file (CSE205_Assignment01.java) with a main method and supporting methods (MAKE NO CHANGES TO THIS FILE). You must write the following Java files to complete the program BankAccount.java CheckingAccount.java SavingsAccount.java CreditcardAccount.java The specifications for these files are given below (including the UML diagram on the following page) Special requirements All Bank Accounts 1. All bank accounts have a balance stored as an amount of pennies -Al transaction amounts are in pennies 2. All debit amounts will be subtracted from the balance, and all credit amounts will be added to the balance 3. All bank accounts have a non-negative interest rate (0.02 would be a 2% interest rate) 4. When applying interest, interest amount is calculated by multiplying the balance by the interest rate 5. When applying interest, interest amount is added to the balance 6. Interest will not be applied to any account with a balance of zero 7. Debit methods will return false if the transaction cannot be made because of insufficient balance or insufficient credit limit. Otherwise they will return true A savings account cannot have a negative balance The getAccoutInfoAsString method will return a string formatted like this: 1. a. The debit method will return false if an attempt to overdraw the account is made 2. Account type Savings Account ID Balance Interest rate0.01 : 101101 : 123.45 Any CheckingAccount debit that ends with a negative balance will incur an overdraftFee (i.e. the overdraftFee amount will be subtracted from the balance) Interest will not be applied to a Checking account with a negative balance The getAccoutInfoAsString method will return a string formatted like this: 1. 2. 3. Account type Checking Account ID Balance Interest rate0.02 Overdraft fee20.00 : 202202 : 2000.00 Creditcard accounts 1. The balance of a Creditcard account cannot overrun its credit limit a. The debit method will return false if an attempt to overdraw the account is made 2. Interest will not be applied to a Creditcard account with a positive balance The getAccoutInfoAsString method will return a string formatted like this: 3. Account type Creditcard Account ID Balance Interest rate0.03 Credit limit 10000.00 : 303303 : -275.50

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Office 365 For Beginners 2022 8 In 1

Authors: James Holler

1st Edition

B0B2WRC1RX, 979-8833565759

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago