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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

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.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,