Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Worksheet Two: Working with Classes 2 Task#1 (methods calls, if statement, object refers this) In this lab assignment you will implement three classes, different

java image text in transcribed
image text in transcribed
image text in transcribed
Worksheet Two: Working with Classes 2 Task\#1 (methods calls, if statement, object refers this) In this lab assignment you will implement three classes, different methods and use internal and external method calls. During this semester we can refine the assignment to define, that a clerk can also be a client of a bank and that clients can have more than one single account. For instance, we start with a small application. implement the following three classes with the described characteristics: classClerk - Fields: - Constructor: - takes as parameters the name and phoneNb and initializes the fields - Methods: - getter-methods for name and phoneNb class Account - Fields: - Constructor: - takes as parameters the number, the initial balance and the client and initializes the fields to these values. Clerk is set to null. - Methods: getter methods for: clerk, balance setter method for clerk as well as the following two methods class Client - Fialds: - Constructor: The constructor takes the id, the name and the address as parameters and initializes the fields to these values. It assigns null to the bank account. - Methods: - getter-methods for name, address - setter-method for address - getter-method for account - as well as the following 6 methods. - All methods that use the bank account must test, whether the bank account is null (if (account I= nuli); in case the bank account is null, they do nothing. In Lab Assignments It is required that the possible credit (i.e. negative balance) of each account is limited. - add a new field credit (positive float value) with a getter and a setter method. The setter method only changes the credit value, if the new value is 0. - modify the takeOff method in the following way: return type is now boolean indicating whether money can be deducted from the account or not money can be deducted only if it does not exceeds the credit limit. - modify the existing constructor: credit is set to 0 - add an overloading constructor taking an additional parameter for credit. If the parameter's value is

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

Connect with your audience

Answered: 1 week ago