Get Similar Asssignment Answers, Essays & Custom Paper Writing Services

To hire a writer, fill the order form with details from your nursing assessment task brief—assignment instructions.

Posted: February 26th, 2022

Lab Assignment 6 More Classes and Objects

Lab Assignment 6 More Classes and Objects

Lab Goals:

 Be capable to derive a category from an current class

 Be capable to outline a category hierarchy during which strategies are overridden and fields are

hidden

 Be capable to use derived-class objects

 Implement a replica constructor

Introduction

On this lab, you’ll be creating new lessons which might be derived from a category referred to as

BankAccount. A checking account is a checking account and a financial savings account is a financial institution

account as effectively. This units up a relationship referred to as inheritance, the place BankAccount is

the superclass and CheckingAccount and SavingsAccount are subclasses.

This relationship permits CheckingAccount to inherit attributes from BankAccount

(like proprietor, stability, and accountNumber, however it could actually have new attributes which might be

particular to a checking account, like a charge for clearing a verify. It additionally permits

CheckingAccount to inherit strategies from BankAccount, like deposit, which might be

common for all financial institution accounts.

You’ll write a withdraw technique in CheckingAccount that overrides the

withdraw technique in BankAccount, in an effort to do one thing barely totally different than

the unique withdraw technique.

You’ll use an occasion variable referred to as accountNumber in SavingsAccount to

conceal the accountNumber variable inherited from BankAccount.

The UML diagram for the inheritance relationship is as follows:

Copyright © 2022, Dallas Faculty.

Copyright © 2022, Dallas Faculty.

Copyright © 2022, Dallas Faculty

Job #1 Extending the BankAccount Class

1. Copy the information AccountDriver.java (Code Itemizing 10.1) and BankAccount.java (Code Itemizing 10.2) from the Pupil CD or as directed by your teacher. BankAccount.java is full and is not going to must be modified.

2. Create a brand new class referred to as CheckingAccount that extends BankAccount. three. It ought to include a static fixed FEE that represents the price of clearing one

verify. Set it equal to 20 cents. four. Write a constructor that takes a reputation and an preliminary quantity as parameters. It

ought to name the constructor for the superclass. It ought to initialize accountNumber to be the present worth in accountNumber concatenated with –10 (All checking accounts at this financial institution are recognized by the extension –10). There may be just one checking account for every account quantity. Keep in mind since accountNumber is a personal member in BankAccount, it should be modified by way of a mutator technique.

5. Write a brand new occasion technique, withdraw, that overrides the withdraw technique within the superclass. This technique ought to take the quantity to withdraw, add to it the charge for verify clearing, and name the withdraw technique from the superclass. Keep in mind that to override the tactic, it will need to have the identical technique heading. Discover that the withdraw technique from the superclass returns true or false relying if it was in a position to full the withdrawal or not. The strategy that overrides it should additionally return the identical true or false that was returned from the decision to the withdraw technique from the superclass.

6. Compile and debug this class.

Job #2 Making a Second Subclass

1. Create a brand new class referred to as SavingsAccount that extends BankAccount. 2. It ought to include an occasion variable referred to as price that represents the annual

rate of interest. Set it equal to 2.25%. three. It also needs to have an occasion variable referred to as savingsNumber, initialized to Zero.

On this financial institution, you might have one account quantity, however can have a number of financial savings accounts with that very same quantity. Every particular person financial savings account is recognized by the quantity following a touch. For instance, 100001-Zero is the primary financial savings account you open, 100001-1 could be one other financial savings account that’s nonetheless a part of your similar account. That is so as to maintain some funds separate from the others, like a Christmas membership account.

four. An occasion variable referred to as accountNumber, that may conceal the accountNumber from the superclass, also needs to be on this class.

5. Write a constructor that takes a reputation and an preliminary stability as parameters and calls the constructor for the superclass. It ought to initialize accountNumber to be the present worth within the superclass accountNumber (the hidden occasion variable) concatenated with a hyphen and then the savingsNumber.

Copyright © 2022, Dallas Faculty

6. Write a technique referred to as postInterest that has no parameters and returns no worth. This technique will calculate one month’s value of curiosity on the stability and deposit it into the account.

7. Write a technique that overrides the getAccountNumber technique within the superclass. eight. Write a replica constructor that creates one other financial savings account for a similar individual.

It ought to take the unique financial savings account and an preliminary stability as parameters. It ought to name the copy constructor of the superclass, and assign the savingsNumber to be yet another than the savingsNumber of the unique financial savings account. It ought to assign the accountNumber to be the accountNumber of the superclass concatenated with the hyphen and the savingsNumber of the brand new account.

9. Compile and debug this class. 10. Use the AccountDriver class to check out your lessons. In the event you named and created your

lessons and strategies accurately, it should have no difficulties. If in case you have errors, don’t edit the AccountDriver class. You could make your lessons work with this program.

11. Working this system ought to give the next output: Checking Account Quantity 100001-10 belonging to Benjamin Franklin

Preliminary stability = $1000.00

After deposit of $500.00, stability = $1500.00

After withdrawal of $1000.00, stability = $499.80

Financial savings Account Quantity 100002-Zero belonging to William Shakespeare

Preliminary stability = $400.00

After deposit of $500.00, stability = $900.00

Inadequate funds to withdraw $1000.00, stability = $900.00

After first month-to-month curiosity has been posted, stability = $901.69

After second month-to-month curiosity has been posted, stability = $903.38

Financial savings Account Quantity 100002-1 belonging to William Shakespeare

Preliminary stability = $5.00

After deposit of $500.00, stability = $505.00

Inadequate funds to withdraw $1000.00, stability = $505.00

Checking Account Quantity 100003-10 belonging to Isaac Newton

After deposit of $1000.00, stability = $6000.00

Financial savings Account Quantity 100004-Zero belonging to Isaac Asimov

Preliminary stability = $500.00

After deposit of $500.00, stability = $1000.00

After month-to-month curiosity has been posted, stability = $1001.88

Order | Check Discount

Tags: write my history essay for me, psychology assignment topics, online nursing papers, online nursing essay writing service, nursing assignment writers

Online Nursing Papers—Assignment Help For You!

Special Offer! Get 20-30% Off Your Order!

Why Seek Our Custom Writing Services

Every Student Wants Quality and That’s What We Deliver

Graduate Essay Writers

Only the most qualified writers are selected to be a part of our research and editorial team, with each possessing specialized knowledge in specific subjects and a background in academic writing.

Affordable Prices

Our prices strike the perfect balance between affordability and quality. We offer student-friendly rates that are competitive within the industry, without compromising on our high writing service standards.

100% Plagiarism-Free

No AI/chatgpt use. We write all our papers from scratch thus 0% similarity index. We scan every final draft before submitting it to a customer.

How it works

When you decide to place an order with Nursing Study Bay, here is what happens:

Fill the Order Form

You will complete our order form, filling in all of the fields and giving us as much guidelines - instruction details as possible.

Assignment of Writer

We assess your order and pair it with a skilled writer who possesses the specific qualifications for that subject. They then start the research/writing from scratch.

Order in Progress and Delivery

You and the assigned expert writer have direct communication throughout the process. Upon receiving the final draft, you can either approve it or request revisions.

Giving us Feedback (and other options)

We seek to understand your experience. You can also review testimonials from other clients, from where you can select your preferred professional writer to assist with your homework assignments.

For Similar Answers, Custom Essay Writing & Assignment Help Services

Find an expert by filling an order form for your nursing paper. We write AI-plagiarism free essays and case study analysis. Anytime!

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00