Computers and Technology

Part 1 scoping and multiple constructors create a class named pizza that stores information about a single pizza. it should contain the following:

a. private instance variables to store the size of the pizza (either small, medium, or large), the number of meat toppings, the number of veggie toppings and whether or not the pizza should be vegan-friendly (in which case you must make sure that the number of meat toppings is 0). discuss with your partner what the difference between a private and public instance variable is.
b. constructors that set all of the instance variables. one constructor should be a no-arg constructor, with defaults of medium, no toppings, non-vegan.
c. at least one other constructor should enable you to give all the private instance variables a value when you create the object. you should also include error checking to make sure the values you are setting are legitimate (e. g., there is no such a size pizza as "grande"). discuss with your partner why there is more than one kind of constructor and when will each constructor be used.
d. public methods to get and set the instance variables. discuss with your partner what would happen if these methods were set to private and why these accessor and getter methods are needed. a public method named calccost that returns a double that is the cost of the pizza. pizza cost is determined by:

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:40, kaileyy06
Match each feature of e-publishing as an advantage, a disadvantage, a threat, or an opportunity. (choices) increased collaboration digitalized out-of-print versions monopoly over digital formats requirement for a specialized digital device pairs advantage of e-publishing disadvantage of e- opportunity for e- threat to e-
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, Cinders13
How can you make your column headings stand out?
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, ilovewaffles70
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
image
Computers and Technology, 24.06.2019 07:30, Isabellawuzhere
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
Do you know the correct answer?
Part 1 scoping and multiple constructors create a class named pizza that stores information about a...

Questions in other subjects: