A furniture store specializes in office furniture and sells Office Chairs, Desks and Book Shelves. Customers can buy furniture using the application of the furniture shop.   Create a class Furniture having id, finishing/polish, and price provide appropriate methods for the data members provide toString method and a method Buy which simply prints “Buying A Furniture”; as type of furniture is not specified.   Next create class Chairs having fabric (String), arms (Boolean), as data members this extends the functionality of Furniture class. Provide appropriate methods for data members, also provide an override method Buy which helps customers buy the chair please note the following Arms are optional if customers wants to have armed chair then it will add extra cost of 1000 to the original price of chair otherwise price remains same. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000. Ask user for quantity and then calculate the bill and display proper receipt to user.     Then create class Desks having number of drawers as data member this also extends furniture class, provide appropriate methods and an override method Buy method which will calculate and display cost of buying desk to user, keep in mind For Desks having drawers more than 3 will add extra charges of 500 per drawer. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000. Ask user for quantity and then calculate the bill and display proper receipt to user.       There is Book Shelves inherited from Furniture class having number of Racks as data members. Provide appropriate methods and this also overrides Buy method of parent class which will calculate and display cost of buying desk to user, keep in mind For Shelves having racks more than 10 will add extra charges of 1500. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000. Ask user for quantity and then calculate the bill and display proper receipt to user.     Now in main class create an object array of Furniture type, create following menu Add Furniture View All Buy A furniture   If user chooses 1st option then asks user for the type of furniture as Chairs Desks BookShelf Create the object of that type and add it to the array After that if user choses 2nd option then display all values. If user chooses the 3rd option again ask the user about type of furniture i.e. chairs, Desks or BookShelf he/she wants to Buy and then call appropriate Buy method of that particular class. This repeats until user presses 0 to exit the program. Note: You have to follow concepts of Inheritance and polymorphism.   Rubric: Remember and Implement abstraction and encapsulation as proper implementation of both carries marks  Implement Concept of Inheritance correctly.  Implement the Polymorphism appropriately Provide Input Validation checks in the setters, for e.g price should not have negative value entered.  Provide toString() method Provide main which implements the user interaction. Logic making  Proper working code

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

A furniture store specializes in office furniture and sells Office Chairs, Desks and Book Shelves. Customers can buy furniture using the application of the furniture shop.

 

Create a class Furniture having id, finishing/polish, and price provide appropriate methods for the data members provide toString method and a method Buy which simply prints “Buying A Furniture”; as type of furniture is not specified.

 

Next create class Chairs having fabric (String), arms (Boolean), as data members this extends the functionality of Furniture class. Provide appropriate methods for data members, also provide an override method Buy which helps customers buy the chair please note the following

  1. Arms are optional if customers wants to have armed chair then it will add extra cost of 1000 to the original price of chair otherwise price remains same.
  2. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000.
  3. Ask user for quantity and then calculate the bill and display proper receipt to user.

 

 

Then create class Desks having number of drawers as data member this also extends furniture class, provide appropriate methods and an override method Buy method which will calculate and display cost of buying desk to user, keep in mind

  1. For Desks having drawers more than 3 will add extra charges of 500 per drawer.
  2. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000.
  3. Ask user for quantity and then calculate the bill and display proper receipt to user.

 

 

 

There is Book Shelves inherited from Furniture class having number of Racks as data members. Provide appropriate methods and this also overrides Buy method of parent class which will calculate and display cost of buying desk to user, keep in mind

  1. For Shelves having racks more than 10 will add extra charges of 1500.
  2. User can also change color of polish (options available brown, black and white). Price of black and brown are Rs 2,000 each whereas price of white chair is Rs 3,000.
  3. Ask user for quantity and then calculate the bill and display proper receipt to user.

 

 

Now in main class create an object array of Furniture type, create following menu

  1. Add Furniture
  2. View All
  3. Buy A furniture
  4.  

If user chooses 1st option then asks user for the type of furniture as

  1. Chairs
  2. Desks
  3. BookShelf

Create the object of that type and add it to the array

After that if user choses 2nd option then display all values. If user chooses the 3rd option again ask the user about type of furniture i.e. chairs, Desks or BookShelf he/she wants to Buy and then call appropriate Buy method of that particular class. This repeats until user presses 0 to exit the program.

Note: You have to follow concepts of Inheritance and polymorphism.

 

Rubric:

  • Remember and Implement abstraction and encapsulation as proper implementation of both carries marks 
  • Implement Concept of Inheritance correctly. 
  • Implement the Polymorphism appropriately
  • Provide Input Validation checks in the setters, for e.g price should not have negative value entered. 
  • Provide toString() method
  • Provide main which implements the user interaction.
  • Logic making 
  • Proper working code 
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY