Write a java application that meets the given specifications

Assignment Help Computer Engineering
Reference no: EM132200485

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: EM132200485

Questions Cloud

Write a application that implements a basic text analyzer : Write a Java application that implements a basic Text Analyzer. The Java application will analyze text stored in a text file.
Display the values of the new list on screen : Read each value from the Stack and multiply its value by 7. Store each of the new values to either a Queue (linked list) or a Priority.
A program that allows the user to input a list of words : Write a Java program that allows the user to input a list of words, separated by whitespace.
Creates and returns a new copy of the received array : Write a Java method that Receives an array of integers of any length and Creates and returns a new copy of the received array.
Write a java application that meets the given specifications : Write a Java application that meets the following specifications. Make sure to give the classes and methods the exact names shown in this prompt.
Write an inheritance hierarchy of three-dimensional shapes : Test your classes in a program that asks the user which shape they'd like to create, and what dimensions they'd like to give it.
Write a html files function that computes a taxi fare : Write a HTML and JavaScript files function that computes a taxi fare.
Write down the intermediate words that are constructed : Write down the intermediate words that are constructed after each iteration when the letters in the word "munich" are alphabetically ordered.
Draw a parse tree for the sentence aaababab : Write a grammar for the language consisting of strings built only of the letters a and b. Draw a parse tree for the sentence aaababab.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe way of traversing orchard that will visit vertices

Describe a way of traversing an orchard that will visit the vertices in the same order as postorder traversal of the corresponding binary tree.

  Interview a person about a task he performs on his job

Based on the information you learned in Steps 1 and 2 of The Essential Guide to User Interface Design, interview a person about a task he/she performs on his/her job.

  What are the three items that make up lvm

What are the three items that make up LVM? Wjat is the biggest benefit of using lvm over basic partitions or of using raid array?

  Questionwrite down a function that creates a cell array and

questionwrite down a function that creates a cell array and structure array and populate them with data about element

  Design an fir linear-phase filter

Use MATLAB to design an FIR linear-phase filter that models a low pass band limited channel that has a 1/2 -dB ripple in the pass band I ƒ I = 3000 Hz.

  How do you think the proliferation of technology

How do you think the proliferation of technology and the Internet affects our responsibilities to be good stewards of our talents?

  How do you go about adding an alert

How do you go about adding an alert (both setting up a new alert and adding one to a monitored system)?

  How to write a program to check the collision

How to write a program to check the collision Write down a java program to check if they will collide or not. If they are going to collide print a message that 'The crafts will collide at (x,y)' where co-ordinates (x,y) are on Map as points of co..

  Write a description about cloud technology

Write a description about Cloud Technology and BUSINESS ANALYSIS - CRM & ERP. The information which you provide should be related to IT Industry.

  Design an algorithm that transposes a tri-diagonal matrix

Design an algorithm that transposes a tri-diagonal matrix using the storage scheme devised in the previous part of the exercise.

  Analyze which messages change after we update the parameters

Analyze which messages change after we update the parameters for P(Xi| Ui). Use this analysis to show how, after an initial pre-computation step.

  Create web server access on existing platform

You can design your own or create Web server access on existing platforms such as (sparkfun, xivley, partcl, google chart etc...) however, it has to draw a chart

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