Dragon Inc. is one of the top toy manufacturers in China. In fact, they’re a pioneer in toy manufacturing. They started production at a time when few toys were being produced commercially. Hence, they dominated the market and became the leader in the toy production industry. They produce two kinds of toys i.. Cars and Helicopter. For that there is a Toy class which has name, price, Color as its private data members. Provide a default Constructor. Provide overloaded parameterized Constructors. Provide getters, and setters for the data members. In addition there are three methods Prepare () which is used to prepare a toy, package () which packs the toy in a wrapper, Label () which label the name & Price of the toy on the package. Now create subclass Car having speed, model as its data members, Helicopter having wings, engines as data members, Provide a default Constructor. Provide overloaded parameterized Constructors. Provide getters, and setters for the data members. In addition override the Parent class methods i.e. Prepare (), package () & Label (). Create another class name ToyStore which has Toy object, int quantity, and total bill, Provide a default Constructor. Provide overloaded parameterized Constructors. Provide getters, and setters for the data members. Provide a method Toy OrderToy(String name): This method will create the type of object user wants e.g. If user types car then you have to create a car object, set its values, call the methods i.e. prepare, package, label and return the object. Now in main class create object of ToyStore class, Ask the user for the type of Toy he she wants Car Helicopter Based on user’s choice call the orderToy method, Also ask about quantity of toys then  calculate the total bill and displays on screen.

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

Dragon Inc. is one of the top toy manufacturers in China. In fact, they’re a pioneer in toy manufacturing. They started production at a time when few toys were being produced commercially. Hence, they dominated the market and became the leader in the toy production industry. They produce two kinds of toys i.. Cars and Helicopter.

For that there is a Toy class which has name, price, Color as its private data members.

  1. Provide a default Constructor.
  2. Provide overloaded parameterized Constructors.
  3. Provide getters, and setters for the data members.
  4. In addition there are three methods Prepare () which is used to prepare a toy, package () which packs the toy in a wrapper, Label () which label the name & Price of the toy on the package.

Now create subclass Car having speed, model as its data members, Helicopter having wings, engines as data members,

  1. Provide a default Constructor.
  2. Provide overloaded parameterized Constructors.
  3. Provide getters, and setters for the data members.
  4. In addition override the Parent class methods i.e. Prepare (), package () & Label ().

Create another class name ToyStore which has Toy object, int quantity, and total bill,

  1. Provide a default Constructor.
  2. Provide overloaded parameterized Constructors.
  3. Provide getters, and setters for the data members.
  4. Provide a method Toy OrderToy(String name):

This method will create the type of object user wants e.g. If user types car then you have to create a car object, set its values, call the methods i.e. prepare, package, label and return the object.

Now in main class create object of ToyStore class, Ask the user for the type of Toy he she wants

  1. Car
  2. Helicopter

Based on user’s choice call the orderToy method, Also ask about quantity of toys then  calculate the total bill and displays on screen.

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
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