Academic Writing Experts For Your Research Projects

Order custom papers, masters thesis and dissertation in 3 guided steps; human written!

Posted: February 26th, 2022

Lab Assignment 6 More Classes and Objects

Lab Assignment 6 More Classes and Objects

Lab Objectives:

Who Writes College Essays, Research Papers, and Dissertations For Students?

We handpick every writer with care, ensuring they bring the perfect mix of academic qualifications and writing skills for top-notch results in essays, research papers, and dissertation help. Each one has a university degree, more than a third with Masters certification; they’ve tackled tough tests and training to excel in thesis writing and research paper assignments at any time. They’ll team up with you diligently, keeping things easy and stress-free as they relate to being immediate students. That’s what makes us the best assignment help website for "help me write my essay, research paper, or dissertation" for college coursework. Trust our team—professional research essay writers and editors—to deliver your dissertation or thesis writing within your grading criteria and deadline.

 Be able to derive a class from an existing class

 Be able to define a class hierarchy in which methods are overridden and fields are

hidden

 Be able to use derived-class objects

Do You Offer Thesis Writing and Dissertation Help In Any Citation Style?

No matter what citation style you need for your research paper or dissertation, our skilled writers have you covered! We provide thesis writing and dissertation help in formats like APA, AMA, MLA, Turabian, Harvard, IEEE, and more. We’re dedicated to customizing your order to the exact guidelines of your chosen style, ensuring it fits your unique academic needs—whether it’s a dissertation, research paper, or essay for a specific course. We’ve got the flexibility to make it work for you!

 Implement a copy constructor

Introduction

Can I Change Instructions for Dissertation Help or Thesis Writing After Ordering?

You can absolutely reach out to your academic writer using our simple, user-friendly chat feature. It’s there so you can add details, clarify instructions, or tweak adjustments for editing your research paper or dissertation according to your grading rubric—even after you’ve submitted "help me with thesis writing or dissertation help" and they’ve started working on your project.

In this lab, you will be creating new classes that are derived from a class called

BankAccount. A checking account is a bank account and a savings account is a bank

account as well. This sets up a relationship called inheritance, where BankAccount is

the superclass and CheckingAccount and SavingsAccount are subclasses.

This relationship allows CheckingAccount to inherit attributes from BankAccount

(like owner, balance, and accountNumber, but it can have new attributes that are

specific to a checking account, like a fee for clearing a check. It also allows

CheckingAccount to inherit methods from BankAccount, like deposit, that are

universal for all bank accounts.

You will write a withdraw method in CheckingAccount that overrides the

withdraw method in BankAccount, in order to do something slightly different than

the original withdraw method.

You will use an instance variable called accountNumber in SavingsAccount to

hide the accountNumber variable inherited from BankAccount.

The UML diagram for the inheritance relationship is as follows:

Copyright © 2022, Dallas College.

Copyright © 2022, Dallas College.

Copyright © 2022, Dallas College

Task #1 Extending the BankAccount Class

1. Copy the files AccountDriver.java (Code Listing 10.1) and BankAccount.java (Code Listing 10.2) from the Student CD or as directed by your instructor. BankAccount.java is complete and will not need to be modified.

2. Create a new class called CheckingAccount that extends BankAccount. 3. It should contain a static constant FEE that represents the cost of clearing one

check. Set it equal to 20 cents. 4. Write a constructor that takes a name and an initial amount as parameters. It

should call the constructor for the superclass. It should initialize accountNumber to be the current value in accountNumber concatenated with –10 (All checking accounts at this bank are identified by the extension –10). There can be only one checking account for each account number. Remember since accountNumber is a private member in BankAccount, it must be changed through a mutator method.

5. Write a new instance method, withdraw, that overrides the withdraw method in the superclass. This method should take the amount to withdraw, add to it the fee for check clearing, and call the withdraw method from the superclass. Remember that to override the method, it must have the same method heading. Notice that the withdraw method from the superclass returns true or false depending if it was able to complete the withdrawal or not. The method that overrides it must also return the same true or false that was returned from the call to the withdraw method from the superclass.

6. Compile and debug this class.

Task #2 Creating a Second Subclass

1. Create a new class called SavingsAccount that extends BankAccount. 2. It should contain an instance variable called rate that represents the annual

interest rate. Set it equal to 2.25%. 3. It should also have an instance variable called savingsNumber, initialized to 0.

In this bank, you have one account number, but can have several savings accounts with that same number. Each individual savings account is identified by the number following a dash. For example, 100001-0 is the first savings account you open, 100001-1 would be another savings account that is still part of your same account. This is so that you can keep some funds separate from the others, like a Christmas club account.

4. An instance variable called accountNumber, that will hide the accountNumber from the superclass, should also be in this class.

5. Write a constructor that takes a name and an initial balance as parameters and calls the constructor for the superclass. It should initialize accountNumber to be the current value in the superclass accountNumber (the hidden instance variable) concatenated with a hyphen and then the savingsNumber.

Copyright © 2022, Dallas College

6. Write a method called postInterest that has no parameters and returns no value. This method will calculate one month's worth of interest on the balance and deposit it into the account.

7. Write a method that overrides the getAccountNumber method in the superclass. 8. Write a copy constructor that creates another savings account for the same person.

It should take the original savings account and an initial balance as parameters. It should call the copy constructor of the superclass, and assign the savingsNumber to be one more than the savingsNumber of the original savings account. It should assign the accountNumber to be the accountNumber of the superclass concatenated with the hyphen and the savingsNumber of the new account.

9. Compile and debug this class. 10. Use the AccountDriver class to test out your classes. If you named and created your

classes and methods correctly, it should not have any difficulties. If you have errors, do not edit the AccountDriver class. You must make your classes work with this program.

11. Running the program should give the following output: Checking Account Number 100001-10 belonging to Benjamin Franklin

Initial balance = $1000.00

After deposit of $500.00, balance = $1500.00

After withdrawal of $1000.00, balance = $499.80

Savings Account Number 100002-0 belonging to William Shakespeare

Initial balance = $400.00

After deposit of $500.00, balance = $900.00

Insufficient funds to withdraw $1000.00, balance = $900.00

After first monthly interest has been posted, balance = $901.69

After second monthly interest has been posted, balance = $903.38

Savings Account Number 100002-1 belonging to William Shakespeare

Initial balance = $5.00

After deposit of $500.00, balance = $505.00

Insufficient funds to withdraw $1000.00, balance = $505.00

Checking Account Number 100003-10 belonging to Isaac Newton

After deposit of $1000.00, balance = $6000.00

Savings Account Number 100004-0 belonging to Isaac Asimov

Initial balance = $500.00

After deposit of $500.00, balance = $1000.00

After monthly interest has been posted, balance = $1001.88

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

Why choose Homework Ace Tutors

You Want Quality and That’s What We Deliver

Top Academic Writers

We’ve put together our writing team with care, choosing talented writers who shine in their fields. Each one goes through a tough selection process, where we look for folks with deep expertise in specific subjects and a solid history of academic writing. They bring their own mix of know-how and flair to the table, making sure our content hits the mark—packed with info, easy to read, and perfect for college students like you.

College Prices

We don’t do AI-written essays or copycat work—everything’s original. Competitive pricing is a big deal for us; we keep costs fair while delivering top-notch quality. Our writers are some of the best out there, and we charge rates that stack up well against other services. This means you get stellar content without draining your wallet. Our pricing is straightforward and honest, built to give you real value for your money. That’s why students turn to us for high-quality writing services that won’t break the bank.

100% Plagiarism-Free

Academic integrity is at the heart of what we do. Every paper starts from scratch, with original research and writing tailored just for you. We write 100% authentic—no plagiarism research essays. Our strict quality control process includes scanning every draft with top tools like SafeAssign and Turnitin, so you get a similarity score and proof of originality. We’re obsessive about proper citation and referencing too, crediting every source to keep things legit. It’s all about giving you peace of mind with content that meets the highest standards.

How it works

When you decide to place an order with Dissertation Writer, here is what happens:

Complete the Order Form

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

Assignment of Writer

We analyze your order and match it with a writer who has the unique qualifications to complete it, and he begins from scratch.

Order in Production and Delivered

You and your writer communicate directly during the process, and, once you receive the final draft, you either approve it or ask for revisions.

Giving us Feedback (and other options)

We want to know how your experience went and the marking criteria grade you scored. You can leave a review recommending a writer for your class and course mates.