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

  Design a combinational verilog module

The starter code from the course web page includes test benches for each problem below. For each of the following, please submit the source code for your Verilog module along with a printout or screen capture of waveform plots indicating a success..

  Describing the company including the business

Completely describe the company including the business and where the company located. Determine the minimum services that must be maintained for that company.

  Write a program that reads the data from the file mydata.txt

Write a program that reads the data from the file 'mydata.txt', saves it in an array of structures and finally prints the array of structures to the monitor.

  Design a detail report that will display all courses

make a switchboard design with control buttons that lead to students, instructors, courses, course schedules, and course rosters. Allow a user to add, update, or delete records in each area. Jesse wants to see storyboards that show the proposed sc..

  Explain possible control measure for each level of hierarchy

Determine a possible control measure for each of the six levels in the hierarchy of controls, and explain the reasoning behind each choice.

  How many persons are at least born on the same month

How many bit strings of length 8 can be made such that they begin with one zero and end with end with zero?

  Give one example of a group using a set of residues

Show the number of elements in Galois fields in terms of a prime number. Give one example of a group using a set of residues.

  Write a function that converts a phrase into pig latin

A word is converted to pig Latin by removing the ?rst character of the word, placing it at the back of the word,and adding the characters "ay" to the word.

  Explain paging - segmentation and demand paging

Explain Paging, Segmentation and Demand Paging in detail

  Provide the tremendous kind of environment

The Online Canteen Management System is developed to assist in the daily Processes in canteen as well as the catering business.

  The plaintiff while driving a pickup manufactured by the

the plaintiff while driving a pickup manufactured by the defendant was struck in the rear by another motor vehicle.

  What is the difference between ascii and unicode

See if you can do Web searches on ASCII and Unicode. What's the difference between ASCII and Unicode? Why would we need Unicode if we already had ASCII?

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