Create a class that inherits from your pizzaorder class

Assignment Help JAVA Programming
Reference no: EM13811618

Part 1 demonstrates inheritance.

Your Pizza Shop expands and now handles delivery orders and sit down orders in a restaurant setting. There are differences in a SeatedPizzaOrder and a DeliveryPizzaOrder. These are more specialized versions of the PizzaOrders you have been creating all along and you decide to write a program that handles them the same as much as possible and reuses the code of a general PizzaOrder class as much as possible to demonstrate inheritance.

Create a PizzaOrder Class. This class should have the following properties (and their underlying private variables): Size {of type int}, Toppings {of type String}, Price {of type Decimal}. Make a full constructor for the class that takes all three values, and a default constructor that initializes the basic pizza as a 12 inch cheese pizza for $8. Make sure to include validation in your Size and Price properties and constructor to prevent a change to Size that would be less than 12 or greater than 16, and prevent a change to Price that would be less than 0.

Create a class that inherits from your PizzaOrder class called SeatedPizzaOrder. SeatedPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a tablenumber (of type integer) and serverName (of type string) which allows you to track where the pizza is going and who took the order in the restaurant

Create a class that inherits from your PizzaOrder class called DeliveryPizzaOrder. DeliveryPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a driverName (of type string) which allows you to track who is delivering the pizza.

Create a GUI with controls of your choosing or a console class with a main in it. The choice is up to you to create objects of each and test them. This program should allow the user to enter in the values for a SeatedPizzaOrder and the values for a DeliveryPizzaOrder, and after creating an object of each one, it should displays their values (from the created objects) for the user.

PART 2

Part 2 is demonstrating polymorphism with classes of different types in an array being processed by a loop.

This program will demonstrate polymorphism and builds on your assignment 1 program. It will allow an array of PizzaOrders of both subclasses....and handle the bills for all of them to be paid all at once polymorphically.

Copy your PizzaOrder, SeatedPizzaOrder, and DeliveryPizzaOrder classes from PART1 into a new project for a C# XXXXX with a GUI.

Change your PizzaOrder from the PART 1 to be an abstract class. Make sure it has an abstract message called printBill().

Change your SeatedPizzaOrder class. Make sure it overrides the printBill() method to return a string with all of the information on the bill along with 10% added to the price.

Change your DeliveryPizzaOrder class. Make sure it overrides the printBill() method to return a string with all of the information on the bill along with $4 added to the price as a delivery fee.

Make a GUI program (with controls of your choosing) that has an array of 4 PizzaOrders in it. Include a checkbox (or radio buttons if you prefer) on the form to control whether it is a DeliveryPizzaOrder or not. Include all the screen controls needed to get the information from the user for either type of order and have a button to allow the user to add a PizzaOrder to the array of either type based on the users choice.

Finally, make sure the GUI include controls to allow the user to see the 4 PizzaOrders bills using printBill() polymorphically once they are all entered. Like a button to call it for the array in a loop, which takes the output from printBill() and adds it to a listbbox for each of them in turn as the loop calls it.

Reference no: EM13811618

Questions Cloud

Inventory turnover ratio times : Universal Sports Supply began the year with an inventory balance of $89,000 and a year-end balance of $55,000. Sales of $690,000 generate a gross profit of $240,000. Inventory turnover ratio times
Calculate firms operating cycle and cash conversion cycle : Camp manufacturing turns over its inventory 5 times each year, has an average payment period of 35 days, and has an average collection period of 60 days. The firm has annual sales of $3.5 million and cost of goods sold of $2.4 million. Calculate the ..
Characteristics of common stock : All of the following are characteristics of common stock except the:
Possesses a high degree of market power : Is MTA a monopolist in New York City? Do you think MTA possesses a high degree of market power? Why or why not?
Create a class that inherits from your pizzaorder class : Create a class that inherits from your PizzaOrder class called SeatedPizzaOrder. SeatedPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a tablenumber (of type integer) and serverName (of type st..
Capital budgeting analyst-marginal benefits and cost : Ken Allen, capital budgeting analyst for Bally Gears Inc., has been asked to evaluate a proposal. The manager of the automotive division believes that replacing the robotics used on the heavy truck gear-line will produce total benefits of 560,000 (in..
Different challenge to expect in the set-up operating : different challenge to expect in the set-up operating, and sustaining
What is the probability that a randomly selected student sco : The scores on an undergraduate Statistics exam are normally distributed with a mean of 75 and a standard deviation of 8. What is the probability that a randomly selected student gets an "A" (score a 90 or above) on this Statistics exam? What score on..
Physical security : As you've learned, physical security doesn't just mean securing systems. It also involves securing the premises, any boundaries, workstations, and other areas of a company. Without physical security, data could be tampered with or stolen, and value i..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create an application for disney''s cottages

Create an application for Disney's Cottages, a weekend getaway resort that rents cottages and boats to use on the local lake

  Write and run a java program

Write and run a Java program which allows the user to input two doubles and outputs the greater of the two?

  Write thejava code for a program

Write theJava code for a program that reads the weight of a piece of luggage and print the proper message, depending on the weight, as per the table below.

  Explain how the loop displaying the menu

Explain how the loop displaying the menu is exited, what value does menuSel have when the program finishes? Describe what happens next when menuSel gets this value.

  Simulate some people catching fish in a lake in java program

In this project, you will simulate some people catching fish in a lake. The purpose of the assignment is to get used to using Arrays as well as getting more experience in having objects interact together.

  Write the java code for an abstract class named account

Write the Java code for an abstract class named Account which has two data members; one for the account number and the other for the account balance (use information hiding). The Account class should include get and set methods for both data membe..

  Developing a java application

You have been requested to develop a Java application for the local library as part of an upgrade initiative. As in all libraries, this is a place where one can check out books

  Rewrite the following method using a while loop

Rewrite the following method using a while loop using an Iterator instead of the For each loop, files is an ArrayList storing String objects, also include ANY addition that you would need to have anywhere in the class.

  Compare swing java gui components to awt components

Compare Swing Java GUI components to AWT components. Explain at least one way the components are similar and at least one way they are different.

  How control constructs and arrays would resolve problem

Arrays and control structures are valuable tools when programming. An array contains a number of variables all being the same data type. Explained the situation and how control constructs and arrays would resolve problem

  Define java implementation to implement the requirements

Produce a Java implementation to implement the requirements of Question 1, that is, to perform the 32-bits two complement and 32-bit floating-point conversion of a given number.

  The bookstore wants you to make an object-oriented model

student bookstore at pleasant creek community college situation the bookstore staff at pleasant creek community college

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd