Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I know it's very beginner stuff but struggling on this, I have been looking at tutorials and tried a bunch of different things, but nothing

I know it's very beginner stuff but struggling on this, I have been looking at tutorials and tried a bunch of different things, but nothing seems to work.

change the constructor from:

 
PizzaModified(int price, String type) 

to:

 
PizzaModified(PizzaType type) 

This will cause a number of warnings and compiler errors. You will need to update the rest of the class based on this new parameter, while still keeping all the method names and return types unchanged. Take note of the parameter's type PizzaType, which refers to the provided enum PizzaType.java. This allows you to use the methods in PizzaType to enable you to write cleaner code.

image text in transcribed

JPizza.java ShapeHandler.ja PizzaType.java "1 Main.java PizzaModified.java Shape.java 1 package oop.PizzaModified; 1 package oop.PizzaModified; 3 public class PizzaModified { 4 3 public enum PizzaType f 4 HAWAIIANC10), MEATLOVERSC12), VEGETARIANC9); // Private properties private int price; private String type; private int price; PizzaType(int price) f this.price price 8 /7 Constructs a Pizza object with a price and a 9public PizzaModified(int price, String type) 10 10 this.price price; this.type type; 12 public int priceO 13 14 15 12 13 14 15 public int priceO 16 17 18 19 return price; // Gets the price of the pizza return price; //Gets the type of the pizza public String typeO 21 return type; 23 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions