Giter VIP home page Giter VIP logo

sundae-world's Introduction

Define a class called pizza that has member variables to track the type of pizza (either deep dish, hand tossed, or thin crust) along with the size (small, medium, or large) and the number of pepperoni or cheese toppings. You can use constants to represent the type and size. Create a void function, outputDescription(), that outputs a textual description of the pizza object. Also include a function, computePrice(), that computes the cost of the pizza and returns it as s double according to the rules:

Small pizza = $10 + $2 per topping

Medium pizza = $14 + $2 per topping

Large pizza = $17 + $2 per topping

Include constructors and any other functions needed to make the class work well.

Add an order class that contains a private vector of type Pizza. This class represents a customer’s entire order, where the order may consist of multiple pizzas. Include appropriate functions so that a user of the Order class can add pizzas to the order. Also write a function that outputs everything in the order along with the total price. Include any other functions that are needed.

Include a static variable to keep track of the total number of pizzas sold and a static function to output the number of pizzas sold when the user exits the program.

Write a suitable test program that adds multiple pizzas to an order, and will create more than one order.

Feel free to use some creativity with this one. If you don’t want to use pizzas, you can write it for something else such as ice cream sundaes, as long as it mostly fits the requirements for the problem (2 classes and uses a vector and a static variable).

sundae-world's People

Contributors

katie-ring avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.