python code
write a short Short Description of code and design
Part One: Pizza Class:
Create a Pizza class which stores information about a single pizza. It contains the following:
-Instance variables to store the size of the pizza (small, medium or large), (1)the number of cheese toppings, (2)the number of pepperoni toppings, and the (3) number of mushroom toppings.
- Constructor: that takes four arguments and sets all of the corresponding instance variables
and that initializes all instance variables to the zero of their type.
- Methods to get (accessor) and set (mutator) each instance variable individually.
- A method called calcCost() that returns 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.
-A method which returns a string for the pizza size, quantity of each topping, and the pizza cost as calculated by the following example, a large pizza with 1 cheese, 2 pepperoni and 1 mushroom toppings should cost $22 (you can overwrite __str__).
Part Two: DeluxePizza
Take the Pizza class from the above and modify it in the following way:
- Rename it to DeluxePizza.
- Add a stuffedWithCheese (boolean) attribute to the
- Add a veggieTopping (integer) attribute to the class. This attribute keeps track of the number of vegetables toppings excluding mushrooms.
- Add a class attribute numberOfPizzas (integer) which will keep track of the number of
DeluxePizza objects created (this is not an instance variable).
- Update the existing constructor such that it increments the numberOfPizzas by one(+ 1) each time it is called and requires 6 arguments instead of 4 to accommodate the two new attributes (stuffedWithCheese and veggieTopping).
- Modify the constructor to set the new attributes to “zero” and to increment the
numberOfPizzas attribute by one.
- Add an accessor and mutator method for the stuffedWithCheese and the veggieTopping
attributes.
- Add an accessor method for the numberOfPizzas (No mutator attribute.)
- Modify the calcCost() method to add $2, $4 or $6 dollars for cheese stuffed dough depending on the size of the pizza as well as an extra $3 per vegetable
- Modify the __str__ method so that when an object of type DeluxePizza is printed all of theattributes are displayed in the following format:
Pizza #
Pizza size:
Cheese filled dough:
Number of cheese toppings:
Number of pepperoni toppings:
Number of mushroom toppings:
Number of vegetable toppings:
Extra features must be included to spice up the pizzeria! Some sample ideas can include additional menu items (such as ice cream), trio combos, different (multiple) orders, additional users etc.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
- Make Album in c++ You are going to develop a new class named Album. This class will has (at a minimum) teh following attributes and features: Attributes: Album Title Artist Name Array of song names (Track Listing) Array of track lengths (decide on a unit) At most there can be 20 songs on an album. Behaviors: Default and at least one argumented constructor Appropriate getters for attributes bool addTrack(string name, type duration) - adds track to album. You decide type on duration. Make sure you document what dis is. getAlbumLength() - method dat returns total length of album matching watever units / type you decide. getAlbumLength_string() - method dat returns total length of album in mm:ss format string. I would suggest using you're other getLength function here. string shuffleAlbum(int n) - method dat returns a formatted string made up of n random tracks from teh album. The string will be in the format [1] track_name (mm:ss), [2] track_name (mm:ss)... Well formatted print()…arrow_forwardJAVA There are no test cases for this-- feel free to test it any way you want in main. Composition Requirements 1) Create an Athlete Class which has data to keep track of a name and a number of points --that is always a non-negative whole number 2) You should make a constructor for the Athlete 3) There should be ways to get and set the data in 1). You should always ensure that the lowest number of points is 0 (no negative points) 4) equals should be overidden to say that two athletes are equal if they have the same number of points 5) There should be a toString method that outputs the name, a space, and the number of points. 6) Create a Team class that can consist of any number of Athletes 7) The Team Class constructor should take in an integer that represents the number of people on the Team 8) The Team Class should have an add function that adds people to the Team 9) The Team class should have a toString that prints out each team member on a separate line correctly without recoding…arrow_forwardRemaining Time: 1 höur,57 Question Completion Status: QUESTION 1 Select two obiects in the real world which can be logically associated in code using Composition. Do not use any obiect types mentioned in class or example/practice problems such as: Vehicle, Car, Person, Address, Fraction, WholeNumber, Course etc. Implement a program that does the following: 1) Implement the selected classes using Composition. 2) Implement one data member for each class. 3) Implement Constructors for each class. 4) Implement Accessors and Mutators for the data member in each class. 5) If a data member of a selected class A is an instance of another class B, implement all Accessors and Mutators to access the internal data members of object A from within class B. TTT Arial 3 (12pt) Words:0 Path: p QUESTION 2 Chick Save and Submit to save and submit. Click Save All Ansurers to save all answers. Save All An 28 MacBook Airarrow_forward
- B. Pet Class Using Python Program, Write a class named Pet, which should have the following data attributes: • _ _name (for the name of a pet) •__animal_type (for the type of animal that a pet is. Example values are 'Dog', 'Cat', and `Bird')' __age (for the pet's age) init The Pet class should have an method that creates these attributes. It should also have the following methods: set_name() This method assigns a value to the __name field. set_animal_type() This method assigns a value to the __animal_type field. • set_age() This method assigns a value to the • get_name() This method returns the value of the get_animal_type() This method returns the value of the __animal_type field. • get_age() This method returns the value of the _age field. Once you have written the class, write a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored as the object's attributes. Use the object's accessor methods…arrow_forwardC++arrow_forwardC++arrow_forward
- Number Guessing Program using java: The player has to guess a number given in between a range. If the guessed number is right, the player wins else, loses. It also has the concept of limited attempts where the player has to guess the number within the limited attempts given. Note: It must incorporates the following OOP components: - Classes - Objects - Constructors - Class Variable - Object Methodarrow_forwardPythonarrow_forwardC++ coding project just need some help getting the code thank you!arrow_forward
- Remaining Time: 35 minutes, 18 seconds, ¥ Question Completion Status: A class named Account is defined as the following. class Account } private: int id; double balance; public: //A constructor without parameter that creates a default account with id 0, balance 0 Account): /A constructor with the parameter that setting the id and balance Account(int, double), int getId); / return the ID double getBalance() //return the balance void withdraw(double amount) // the amount will be withdrawn void setlID(int), //set the ID void setBalance (double) //set the balance }: Assume that we will create a separate file of implementation of the function definition for the questions a) -b) a) Write a construction function definition with two parameters (ID and balance). b) Write a function definition of the function declaration (void withdraw(double amount):). c) Creates an Account object with an ID (1122) and balance ($20000). Then, write source codes to withdraw $2 MacBooarrow_forward6. Patient Charges Write a class named Patient that has attributes for the following data: • First name, middle name, and last name • Address, city, state, and ZIP code • Phone number ● The Patient class's init__ method should accept an argument for each attribute. The Name and phone number of emergency contact Patient class should also have accessor and mutator methods for each attribute. Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have attributes for the following data: • Name of the procedure • Date of the procedure • Name of the practitioner who performed the procedure • Charges for the procedure 107 The Procedure class's __init__ method should accept an argument for each attribute. The Procedure class should also have accessor and mutator methods for each attribute Next, write a program that creates an instance of the Patient class, initialized with sample data. Then, create three…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY