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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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