Implement a class Product. A product has a name and a price, for example new Product(Toaster, 29.95

Question:

Implement a class Product. A product has a name and a price, for example new Product("Toaster", 29.95 ). Supply methods getName, getPrice, and reducePrice. Supply a program ProductPrinter that makes two products, prints each name and price, reduces their prices by $5.00, and then prints the prices again.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Big Java, Enhanced Early Objects

ISBN: 9781119499091

7th Edition

Authors: Cay S Horstmann

Question Posted: