Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING: A factory produces three types of machines in different specifications: printers, scanners and smartphones. Create an abstract class called Machine which includes a

JAVA PROGRAMMING:
image text in transcribed
image text in transcribed
image text in transcribed
A factory produces three types of machines in different specifications: printers, scanners and smartphones. Create an abstract class called Machine which includes a machine name price, weight and a description. Include set and get methods for each one of these fields. The methods which set the machine's price and weight are abstract. Create three Machine child classes and name them: Printer, Scanner and Smartphone. The three machines must have prices and weights within a certain range as the table below shows Price Range Machine Printer Weight Range Less than 50 lbs$40-$200 inclusive Default: 25 lbs 2 lbs - 25 lbs Default: 10 lbs 0.25 lbs 0.5 lbs $220-$350 inclusive Default: 0.3 lbs Default: $90 $60-$300 inclusive Default: $80 Scanner Smartphone Default: $200 You are expected to check on the ranges in your set methods. If the value is not within the range, it will automatically be set to the default value Write an application named MachineTest that creates an array of ten objects. It should show how objects of each category. For each machine, display the machine name, price, weight and a description. Save your files as Machine.java, Printer.java, Scanner.java, Smartphone.java, and TestMachine.java your program works for different Below is an output and it should look like this (NOTE: You lose points if the output is in a different format)

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions