use the c++ to answer the following quesiton The following class Pizza has incomplete codes. Write setter and getter methods for all instance variable of the class, create parameterized constructor of this class, use isLargePizza() method, and toString() method. publicclass Pizza { String name; doublediameter; //constructor voidPizza() { //Missing Lines } public String isLargePizza() { // missing lines } @Override public String toString() { // missing lines returnsuper.toString(); } Hint: When the size of the pizza is greater than 20cm, then it must be considered as large pizza. The islargePizza() method must return boolean value indicating whether the pizza is large or not. Also, correct the given code where necessary.
use the c++ to answer the following quesiton
The following class Pizza has incomplete codes. Write setter and getter methods for all instance variable of the class, create parameterized constructor of this class, use isLargePizza() method, and toString() method.
publicclass Pizza {
String name;
doublediameter;
//constructor
voidPizza()
{
//Missing Lines
}
public String isLargePizza()
{
// missing lines
}
@Override
public String toString() {
// missing lines
returnsuper.toString();
}
Hint: When the size of the pizza is greater than 20cm, then it must be considered as large pizza. The islargePizza() method must return boolean value indicating whether the pizza is large or not.
Also, correct the given code where necessary.
Step by step
Solved in 2 steps