Home PEx Chat Small Talk

pasagot naman po please midterm period po :(((

Create a class named pizza, Data fields include String for toppings (such as "pepperoni") an integer for diameter in inches (such as 12) and double the price (such as 100.00) include the methods to get and set values for each of these fields.


Create a class named pizza TestPizza that instantiates one pizza objects and demonstrates the use of the pizza set and get methods.


pasagot po please nahihirapan po ako eh :(( huhu. salamat ng madami

Comments

  • balbolskibalbolski PEx Influencer ⭐⭐⭐
    bakit hindi mo tawagan yun pizza hut delivery o yun shakeys?

    :glee:
  • IProgrammerDudeIProgrammerDude PEx Rookie ⭐
    adniel wrote: »
    Create a class named pizza, Data fields include String for toppings (such as "pepperoni") an integer for diameter in inches (such as 12) and double the price (such as 100.00) include the methods to get and set values for each of these fields.




    Create a class named pizza TestPizza that instantiates one pizza objects and demonstrates the use of the pizza set and get methods.




    pasagot po please nahihirapan po ako eh :(( huhu. salamat ng madami

    Answer in C#

    public class Pizza
    {
    public string Toppings { get; set; }
    public int Diameter { get; set; }
    // decimal is much more preferred for financial representations as it handles floating points more accurately and efficiently
    public decimal Price { get; set; }
    }

    usage

    class Program
    {
    static void Main(string[] args)
    {
    Pizza testPizza = new Pizza();

    testPizza.Toppings = "Pepperoni";
    testPizza.Diameter = 12;
    // "M" is used to denote that the number provided is a decimal by default it is treated as a double
    testPizza.Price = 100.00M;


    Console.WriteLine("The Topping is:" + testPizza.Toppings);
    Console.WriteLine("The Size of your Pizza is:" + testPizza.Diameter.ToString());
    Console.WriteLine("The Price of your Pizza is:" + testPizza.Price.ToString());
    Console.ReadLine();
    }
    }
  • ParkourParkour PEx Influencer ⭐⭐⭐
    tumblr_lzayjb1JAL1r18azjo1_250.gif

    :rolleyes:
  • thank you po kuya. nalilito lang po kase ako kung anong method gagawin ko :)))))) salamat po
  • IProgrammerDudeIProgrammerDude PEx Rookie ⭐
    adniel wrote: »
    thank you po kuya. nalilito lang po kase ako kung anong method gagawin ko :)))))) salamat po


    No prob. kung may question ka pa can PM me directly *okay*
  • @adniel: you're the one asking for java codes a few months ago, right?

    so sa C# ka na ngayon? nice. they actually have a lot of similarities. if you could code with java, you'll be able work with C# in no time.

    Parkour wrote: »
    tumblr_lzayjb1JAL1r18azjo1_250.gif

    :rolleyes:

    and your problem is?

    just STFU if you can't be of any help instead of spewing nonsense.
  • balbolski wrote: »
    bakit hindi mo tawagan yun pizza hut delivery o yun shakeys?

    :glee:

    wahahaha! :lol:
  • ParkourParkour PEx Influencer ⭐⭐⭐
    whiplash wrote: »
    and your problem is?

    just STFU if you can't be of any help instead of spewing nonsense.

    tumblr_m8q5iwUd4h1rvi21eo1_250.gif
    tumblr_n8t297FP0J1rfduvxo1_250.gif
  • @adniel: you're the one asking for java codes a few months ago, right?

    so sa C# ka na ngayon? nice. they actually have a lot of similarities. if you could code with java, you'll be able work with C# in no time.



    yes po ako po medyo nalilito lang me sa pag construct ng methods when it comes to oop kaya im asking the help of professionals baka sakaling ma help nio ako :)) salamat po ulit
Sign In or Register to comment.