Demonstrate your work

Assignment Help Computer Engineering
Reference no: EM132200518

Write a Java application that meets the following specifications. Make sure to give the classes and methods the exact names shown in this prompt, since I will be testing them using my own test class.

The abstract class Pizza has two subclasses Pizza, namely TypeAPizza and TypeBPizza.

TypeAPizzas are round and weigh 25 grams per square centimeter, while TypeBPizzas are square and weigh 50 grams per square centimeter.

Every Pizza initially has ten slices with equal areas. Each Pizza contains zero or more toppings, stored in a list. Each topping name is a String. Think about what other variables you need.

Every Pizza has the following methods. At least one of these methods should be abstract in Pizza, but I have not indicated which one(s):

public void addTopping(String t) adds a topping to the pizza

public boolean checkTopping(String t) returns true if the pizza has a particular topping, otherwise false. Think carefully about the String comparisons.

public Double getCurrentAreaInSqCM() returns the current surface area in square CM

public double getCurrentWeightInGrams() returns the current weight of the pizza in grams

public double eatSlice() returns the weight of one slice if one is available; otherwise returns zero. Also does whatever is necessary to ensure that future calls to getCurrentAreaInSqCM() and getCurrentWeightInGrams() will reflect the reduced amount of pizza remaining.

Each type of Pizza needs a constructor. Think carefully about the parameters. Hint: Remember that variables that are protected, rather than private, in Pizza can be accessed from the subclasses.

You do not need to take user input for this problem. Use a driver class to thoroughly demonstrate your work. The driver class should create Pizzas of various sizes and demonstrate that all the methods work correctly.

Reference no: EM132200518

Questions Cloud

Read an input file containing text and a single word : Write a Java application that reads an input file containing text and a single word.
Prompt the user for pairs of inputs of a product number : Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold.
Write a code program with a loop that lets the user enter : Write a java code program with a loop that lets the user enter a series of positive integers.
Calculate the time required for each of three trip : Prompts the user for destination, number of miles driven, and speed driven (both as integer values).
Demonstrate your work : The driver class should create Pizzas of various sizes and demonstrate that all the methods work correctly.
Check whether an array of integers is gigantic not : Write a Java method that checks whether an array of integers is gigantic not.
Write a method that creates an array of ten doubles : Write a method that creates an array of ten doubles, initializes it with ten values taken from console input and returns a reference to the array.
Explain the common ion effect : Explain the common ion effect. Explain the relationship between Ka for an acid and Kb for its conjugate base.
Write a java program to accept positive integers from user : Write a Java program to accept positive integers from the user at the command line. The user can enter as many integers as they like. Use -1 as a sentinel.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write an assignment statement that assigns the value

Write an assignment statement that assigns the value in the txtBirthday control to the strBirthday member contained in the last array element.

  Describe one to two different kinds of tests

Describe one to two different kinds of tests that can be performed for the Disaster Recovery Plan. Need atleast 300-350 words.

  Take movie of a location and a movie shot in front of screen

Take a movie of a location and a movie shot in front of a green screen and use chromakey to blend the two movies together.

  Information is data that is framed in a specific context in

information is data that is framed in a specific context. in this sense information is contextual data that has a level

  Find out and show the percentage of instances

Choose two factor variables. For each factor variable, show a barplot of the number of instances (or count) with a nominal value for each possible value.

  Discuss the technical aspects of a random number generator

Discuss the technical aspects of a Random Number generator and Pseudo-Random Number generator to include their appropriate applications

  Identify the correct function to secure incidents of ken

Identify the correct function to secure incidents of Ken 7. Explain with proper reasoning your choice of the software tools to be used for Ken 7.

  List the four math functions of plcs

Data manipulation instructions can be combined with arithmetic (math) ­instructions.

  Create a script that uses the getframe function

Create a script that uses the following functions: getframe, movie and movie2avi to plot the following functions on the same figure.

  Charlie likes alices picture-password system of the prior

charlie likes alices picture-password system of the previous exercise but he has changed the login so that it just

  Review problem on command and natural language

The president of your company approached you with his iPhone in one hand and his iPad in the other. He has just purchased the iPhone 4S and is fascinated.

  Draw the search space expanded for a lowest-cost-first

Give a non-trivial heuristic function h that is an underestimate of the real cost. [Note thath(n)=0 for all n is the trivial heuristic function.]

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