The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 3 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Need help with this assignment, thanks in advance!
The files must be called <LiFiUnit5Ch14.java> (driver program)
LiFiPizza.java
LiFiCheese.java (which extends LiFiPizza)
Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.
Style Components
Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.
Topics with * are covered in this assignment. Ensure you use every item listed below in your completed assignment.
*Object class
*equals method
toString method
*Polymorphism
Abstract
Interfaces
Protected access modifier
Basic Requirements
Write a super basic Pizza ordering system using Polymorphism.
The setCrust method varies based on which type of Pizza is instantiated.
LiFiUnit5Ch14
Get input for Cheese or Meat pizza.
Declare a single pizza to be used for both Cheese and Meat
If a Meat pizza is selected
o instantiate your pizza as a LiFiPizza pizza with zero arguments
o setType to Meat via the constructor
If a Cheese pizza is selected,
o Instantiate your pizza as a LiFiCheese pizza with zero arguments.
Output of your order varies based on Cheese or Meat (See Example)
LiFiPizza.java
Default constructor should set pizzaType to Meat and cost to $5
setCrust()
o Call setCrust and allow selection of Thin or Thick crust
setIngredients()
o and allow for only 1 ingredient
setCost()
o add $2 to the initial cost which is $5
Include accessor methods as needed.
Ensure all instance variables are private
LiFiCheese.java
Set the type to cheese via the constructor body.
setCrust() – (notice this is different from LiFiPizza setCurst method)
o Automatically set it to “Thin” crust, no option to change, sorry.
output should be like below
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly