Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete Java program that creates the following classes: 1. class PizzaOrder which implements the Comparable interface and contains the following attributes and member

image text in transcribed
Write a complete Java program that creates the following classes: 1. class PizzaOrder which implements the Comparable interface and contains the following attributes and member methods: - customenName (String) For this assignment, you will use the same classes you created in Project phase I ( PrzzaOrder, Delivery. ToGo, and Seated) and build a javatx GUl to provide input and output as follows: - dateordered (Date) Your Driver class should first build and display a cul containing the following items: - pizzasize (final static int SMALL=1, MEDIUM=2. LARGE=3) - customerName ( String) - default empty - numberoftoppings (int) - orderType (ToCo, Delivery, or Seated) - default ToGo - toppingPrice (double) 0 pizzasize (int 1 = SMALL, 2-MEOruM, and 3 = LARiGE) - default 1 (SMALL) - Appropriate constructors (default and non default) as well as the - List of Toppings ( at least three: Onions, Olives, and Green Peppers) default none appropriate senter and getter methods: o toppingPrice (double) - default (10) - A toString() method. 0 orderPrice (double) - defsult (0.0) o Method calculateOrdetPrice() which calculates the price of the pizza order as follows: You are free to design your interlace, but you need to at lesst ise ONE OF ( numberortoppings " toppingPrice) ' pizzasize EACH of the following ( you may use more that one of each if you like): a Method printorderinfo 0 which peints only the customer's name and the - Label calculated order price on one line to the screen. - Butron - Checkfar 2. class Delivery which extends PizzaOrder and contains the following attribute and - Radiobutton methods: - ComboBer - tripRase (double ) - Tertfield - zone ( int 1-4) - Appropriate constructors (default and non default) as well as the appropriate senter and getter methods. The default GUll displayed should NOT have any Labels or Text fields for - tostring0) method that overrides the method in PizzaOrder. tripRare (double), rone (int), Servicecharge (double), nor numberorPeople - A calculateOrderprice() method which overnides the method in PizzaOrder and adds the (tripRate/100 * totalprice * zone ) to the price. 3- class ToGo which extends PizzaOrder. 4- Class Seated which extends PizzaOrder and contains the following attribute and methods: - serviceCharge (double) - numberofpeople (int) - tostring 0 method that overrides the method in PizzaOrder. - A calculateOrderPrice0 method which overnides the method in PizzaOrder (int). As soon as the user selects a pizza order of type Delvery, a triphate label and text field as well as a zone label and text field should oppear and adds the ( servicecharge " numberorpeople) to the price. appeopriately and if he/she selects a pizza order of type Seated then the tripRate and zone Labels and Textfields should disappear and pet 5. A Driver class which includes the folowing methods; replaced by a sevviceCharge and numberorpeople Labels and Textlields - main method that does the following: zone of serviceCharge + numberoffeople labels and textfields should

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Compare the advantages and disadvantages of external recruitment.

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago

Question

What is job enlargement ?

Answered: 1 week ago