Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Concepts: Classes and Objects Point value: 80 points Write two classes: The XXXX Account class and the XXXXAccountTester class (where XXXX is your Kean email

image text in transcribed
image text in transcribed
Concepts: Classes and Objects Point value: 80 points Write two classes: The XXXX Account class and the XXXXAccountTester class (where XXXX is your Kean email username) XXXx_Account has the following instance variables: (10 points) int (this is assigned using the static variable described below) double double (stored in decimal format-i,e., 4% is stored as .04) Date . balance: * interestRate dateCreated Include a static variable used to assign the id number to each Account in the constructor. The value of the variable will start at 1000, and will increase by one for each Account created Xxxx Account has two constructors: (12 points) A default no-args constructor: sets all instance fields to default values. The dateCreated is set to the current date. The id is assigned using the static variable. A constructor that creates the Account with values for balance and interestRate passed as parameters. The dateCreated is set to the current date. The id is assigned using the static variable. Xxxx Account has the following methods: .getters for all instance variables (10 points) . a withdraw method which subtracts an amount from the balance (5 points) .a deposit method which adds an amount to the balance (5 points) . an addInterest method which calculates the interest amount (interest balance) and .a toString() method that returns all of the instance variables strung together in the adds it to the balance. (7.5 points) following format: (7.5 points) ID: 1000; Balance: $20000.0; Rate: 0.045; Date Created: Thu Oct 04 15:08:40 EDT 2018 XXx_AccountTester, which will have a main method. (16 points total) .The main method which does the following by calling the methods of Account o Create an Account object with balance $20,000 and an interest rate of 0.045. Print the Account, using the toString method .Use the withdraw method to withdraw $2,500 . Use the addInterest method add interest to the account Print the Account again, using the toString method CPS 2231 Computer Organization and Programming Create a second Account object with balance = $10,000 and an interest rate of 0.06 o Print the Account, using the toString method -Use the deposit method to deposit $3,000 - Use the addinterest method add interest to the account Print the Account again, using the toString method Please note the following extra requirements and how the assignment will be graded: . Each student in the pair must submit a copy of the assignment to receive credit. The assignment should be worked on in pairs . The name of the classes must be Xxxx Account and Xxxx AccountTester where XXXX is your Kean email id (2 point). Include a comment at the start of the program with the following (2 point): The name of both students in the pair A description of the class o o Include a comment before each method and constructor explaining what the method will do (2 point) .All code must be indented for readability and consist of only one statement per line (1 point) 5 points will be deducted if class does not compile! ID: 1000; Balance: $20000.0; Rate: 0.045; Date Created: Thu Oct 04 15:08:40 EDT 2018 ID: 1000; Balance: $18287.5; Rate: 0.045; Date Created: Thu Oct 04 15:08:40 EDT 2018 ID: 1001; Balance: 10000.0; Rate: 0.06; Date Created: Thu Oct 04 15:08:40 EDT 2018 ID: 1001; Balance: 13780.0; Rate: 0.06; Date Created: Thu Oct 04 15:08:40 EDT 2018 Make sure that you use the methods of the Account class in the driver. The class should work for any and all amounts

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions