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

  What is the average workload needed for finding a collision

Consider a hash function that outputs 50 bit long hash values. What is the average workload needed for finding second-preimage with this hash function? Similarly, what is the average workload needed for finding a collision? Express the attack aver..

  Build a simple shipping company web application

Who can build a simple SHIPPING COMPANY web application with DATABASE that will be easy to host online. With just few pages but with all necessary functions.

  Why people may be reluctant to use bio-metrics

Thinking about bio-metric authentication, list three reasons why people may reluctant to use bio-metrics. Describe various ways of how to counter the objection.

  Create a powerpoint presentation based on a virus prevention

Create a PowerPoint presentation based on a Virus Prevention document - "Compile a list of strategies for avoiding virus infections and incorporate this list into a document to be sent to all employees" that will be the subject of the presentation..

  Discuss a home improvement project

Tell me about a project that you have been involved in. It does not have to be IT/Computer related. It can be any type of a project ex.

  Explain difference between a state graph and a search tree

For artificial intelligence systems to adapt to new situations, the first task is to develop a method for machines to resolve problems 'on their own'.

  Write a program to handle the flow of widgets

Write a program to handle the flow of widgets into and out of a warehouse. The warehouse will have numerous deliveries of new widgets and orders for widgets.

  Write additional method that accept the array as a parameter

Write an additional method that accepts the array as a parameter and then creates and returns a new array with the double values for all the elements (num *= 2)

  Write a program that computes the markup percentage

Two other marketing terms are: percentage markup = markup/purchase price & profit margin = markup/selling price where the quotients are expressed as percentage

  Explain some of the different file permissions available

Write a 200- to 300-word response in which you provide and explain some of the different file permissions available within UNIX®.

  Design a flowchart and pseudocode using control breaks

design a flowchart and pseudocode using control breaks that enable the user to print invoices for any raw material that is selected.

  Classification with neural networks

COSC2110/COSC2111 Data Mining - Describe the data encoding that is required for this task. How many outputs and how many inputs will there be

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