subject

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:

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
question
Computers and Technology, 23.06.2019 03:30
Many everyday occurrences can be represented as a binary bit. for example, a door is open or closed, the stove is on or off, and the fog is asleep or awake. could relationships be represented as a binary value? give example.
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
You know the right answer?
Part 1 scoping and multiple constructors create a class named pizza that stores information about a...
Questions
question
Mathematics, 29.04.2021 21:20
question
Computers and Technology, 29.04.2021 21:20
question
Mathematics, 29.04.2021 21:20
question
Mathematics, 29.04.2021 21:20
Questions on the website: 13722363