How would I write these?

A NEW.
Produce a Class termed “Pizza”.Files fields comprise a “String” with regard to toppings(such seeing that pepperoni), an “Integer intended for diameter with inches(such because 12), and also a “Double” intended for price(such while 13.99).Include methods to get in addition to set attitudes for each of these fields.Help you save the training as Pizza.java

B.
Create an application named “TestPizza” this instantiates one “Pizza” item and demonstrates having the “Pizza” set and get methods.Help you save this practical application as TestPizza.java

A)
open Class Pizza
Chain topping = “”;
int diameter = 0;
twice price = 0.00;

open Pizza()
// default constructor.
// finish constructor.

open String getTopping()
gain topping;
// finish method.

open int getDiameter()
gain diameter;
// finish method.

open double getPrice()
gain price;
// finish method.

open void setTopping(String topping)
this particular.topping = topping;
// finish method.

open void setDiameter(int diameter)
this particular.diameter = size;
// finish method.

open void setPrice(double price)
this particular.price = price tag;
// finish method.
// finish class.

B)
open Class TestPizza

open static void main(String args)
Pizza p = brand-new Pizza();
p.setTopping(“Cheese & Tomato”);
p.setDiameter(10);
p.setPrice(5.00);

Program.out.println(“Topping:” + p.getTopping());
Program.out.println(“Diameter:” + p.getDiameter());
Program.out.println(“Price:” + p.getPrice());

// finish main.
// finish class.

A)
elegance Pizza

chain toppings;
int diameter;
twice price;

open Toppings acquire return this kind of.toppings; setthis.toppings=value;
open Diameter have return this specific.diameter; established this.diameter = worth;
open Price have return this specific.price; established this.selling price = worth;

B)
static avoid Main(string args)

Pizza p = brand-new Pizza();
p.Toppings = “pepperoni, cheese, mushrooms”;
p.Diameter = TWELVE MONTH PERIOD;
p.Selling price = THIRTEEN.99;

There going mate:)
Ups! I noticed you’ve asked for java value lol This is certainly C#

Need to know what language.

Leave a Reply