[Solved] CS212 Lab 17-Extending a Class: Money

$25

File Name: CS212_Lab_17_Extending_a_Class__Money.zip
File Size: 348.54 KB

SKU: [Solved] CS212 Lab 17-Extending a Class: Money Category: Tag:
5/5 - (1 vote)

Rate this product

Extending a Class: Money.

Create a new project in Eclipse called Lab 17, and import the files from Z:Lab17.

Open all the files.

Observe the class hierarchyThe abstract class Money extends to Bill and Coin. Coin extends to Quarter.

Read through the MoneyMain application and understand how it works. Write classes for Penny, Nickel and Dime using class Quarter as a reference.

Add some pennies, nickels and dimes to the dataSource array and modify the main method so that it will add pennies, nickels and dimes to the wallet.

Run the main application to see that it works.

Notice in the method printWallet that the output string for a Bill is complicated and the output string for a Coin is simple. This is because Coin has a toString method. Provide class Bill with a similar toString method and rewrite the output string in printWallet for the Bills.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS212 Lab 17-Extending a Class: Money[Solved] CS212 Lab 17-Extending a Class: Money
$25