Write a program called Question1.java to store some details of computer boxes (serial number, manufacturer, colour, amount of memory), screens (serial number, manufacturer, colour, size) and accessories (serial number, manufacturer, colour) in a single array, with the options of listing all parts or deleting a particular part. Your program must continuously prompt the user to choose an option from a list and act on that option, until the exit option is chosen. See the sample output below. If a part is not found, output "Not found" instead of "Done". You must use inheritance and polymorphism to model your Box, Screen and Accessories classes (use those exact class names) as subclasses of the same base class, which forms the basis for the array.   Sample IO Welcome to Great International Technology MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit b Enter the serial number 123 Enter the manufacturer Lenovo Enter the colour Beige Enter the amount of memory (MB) 2048 Done MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit s Enter the serial number 456 Enter the manufacturer Phillips Enter the colour Beige Enter the screen size in inches 19 Done MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit a Enter the serial number 789 Enter the manufacturer Logitech Enter the colour Beige Done MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit d Enter the serial number 456 Done MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit l Box: 123, Lenovo, Beige, 2048 Accessories: 789, Logitech, Beige Done MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit q

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Write a program called Question1.java to store some details of computer boxes (serial
number, manufacturer, colour, amount of memory), screens (serial number, manufacturer,
colour, size) and accessories (serial number, manufacturer, colour) in a single array, with the
options of listing all parts or deleting a particular part.
Your program must continuously prompt the user to choose an option from a list and act on
that option, until the exit option is chosen. See the sample output below. If a part is not
found, output "Not found" instead of "Done".
You must use inheritance and polymorphism to model your Box, Screen and Accessories
classes (use those exact class names) as subclasses of the same base class, which forms the
basis for the array.

 

Sample IO
Welcome to Great International Technology
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
b
Enter the serial number
123
Enter the manufacturer
Lenovo
Enter the colour
Beige
Enter the amount of memory (MB)
2048
Done
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
s
Enter the serial number
456
Enter the manufacturer
Phillips
Enter the colour
Beige
Enter the screen size in inches
19

Done
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
a
Enter the serial number
789
Enter the manufacturer
Logitech
Enter the colour
Beige
Done
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
d
Enter the serial number
456
Done
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
l
Box: 123, Lenovo, Beige, 2048
Accessories: 789, Logitech, Beige
Done
MENU: add (B)ox, add (S)creen, add (A)ccessories, (D)elete, (L)ist, (Q)uit
q

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT