Create a class named pizza that stores information

Assignment Help Computer Engineering
Reference no: EM131952285

Assignment Three

You will create a class named Pizza that stores information for a single pizza. The class should include the following:

1) Private field variables that will store the size of the pizza (small, medium, or large), the number of cheese toppings, the number of pepperoni toppings, and the number of mushroom toppings.

2) A constructor that initializes all of the variables.

3) Public methods to get and set the field variables.

4) A public method named calculateCost() that returns a double value with the cost of the pizza.

Pizza cost is determined by:
Small: $10 + $2 per topping
Medium: $12 + $2 per topping
Large: $14 + $2 per topping

Cost should be printed out with the $ and two decimal places.

5) A public method named getDescription() which outputs a description to the screen with the pizza size, quantity of each topping, and the total cost which is called by calculateCost()

You will also create a class called PizzaOrder which will have a main method to create your pizzas. In this main method,

1) You will ask the user to input a pizza size and number of toppings for cheese, pepperoni, and mushroom. Use the constructor to set these values.

2) Print out the description to the screen with getDescription().

3) Restrictions on the input in PizzaOrder: there can be a max of double toppings for cheese, and a max of triple toppings for pepperoni and/or mushroom. Minimum values are zero. You will need to check to make sure the user is entering proper values for the toppings. If they enter an invalid answer, prompt one more time. If they enter an invalid answer a second time, cancel the order and end the program.

Remember to write a program description in comments for your program. You do not need to create a variable dictionary unless you are using variables that are not obviously labelled.

Reference no: EM131952285

Questions Cloud

How would you modify the circuit in digital experiment : How would you modify the circuit in Digital_Exp_06_Part_02a to create a 12-bit adder? What additional parts would the circuit require?
Describe the concept of line-stop authority : Describe the concept of line-stop authority. If you were an operator in a production facility, would you want to have line-stop authority? Why or why not?
Why is it a good idea for workers to inspect their own work : Why is it a good idea for workers to inspect their own work? In what ways are the Malcolm Baldrige award and the Deming Prize similar.
Team of successful government budget analysts : You can refer to skills, qualities, values, experience, education, or knowledge that will a team of successful government budget analysts.
Create a class named pizza that stores information : Create a class named Pizza that stores information for a single pizza. Cost should be printed out with the $ and two decimal places.
Managers and citizens to hold government accountable : What are the its basic elements, how they interact with one another, and how it can provide a useful tool for managers and citizens to hold government
Describe the purpose and the intent of the ISO program : What are the major substantive differences between the quality awards discussed in the chapter and ISO 9000:2008? Are they intended for similar.
Develop an action plan for implementation : What is your diagnosis of the situation for the organization in question? For your preferred intervention, develop an action plan for implementation
Quality management mean for a business : What does the Six Sigma approach to quality management mean for a business?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How might bpr be used in your organization

What is Business Process Reengineering (BPR)? Discuss how BPR might be used and describe the 'theoretical' results.

  Techniques for executing equijoin

Discuss the different techniques for executing equijoin of two files located at different sites.

  Questionenlarge the size of the array to 25 driver will

questionenlarge the size of the array to 25. driver will start with 10 objects in it other than has provision for up to

  Draw a red-black representation of the tree

Draw down 2-3-4 tree built when key EASY QUESTION are inserted into an initially empty tree. Draw a red-black representation of the tree from previous question.

  Describing the microsoft access

Describe what is going on within the Microsoft Access. What role do you think SQL is playing?

  Examine a copy of a manual for a software program

Examine a copy of a manual for a software program such as a word processor, spreadsheet, or database, or examine a help system for a program you use regularly.

  Which there are 200 total unites available in the system

A system has five active processes(A-E) and one type of resource, that there are 200 total unites available in the system. the current state of the system is shown in the table below.

  Create the definition of the function

Write down the definition of the function template moveNthFront that takes as a parameter a queue and a positive integer, n. The function moves the nth element of the queue to the front.

  Find production rules in extended backus-naur form

Give production rules in extended Backus-Naur form that generate a sandwich if a sandwich consists of a lower slice of bread; mustard or mayonnaise.

  Write a recursive program to compute height of a binary tree

Write a recursive program to compute the height of a binary tree: the longest distance from the root to an external node.

  Design spreadsheet to track the statistics of baseball team

Design a spreadsheet to track the statistics of your favorite major league baseball team. Include data regarding runs, hits, errors, and runs-batted-in (RBIs).

  Create a movie poster by drawing text on a picture

Create a movie poster by drawing text on a picture. Rewrite the Jenny's eyes function to double Jenny's eyes, making them appear twice.

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