pasagot naman po please midterm period po :(((
in Small Talk
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
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
:glee:
Answer in C#
public class Pizza
{
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
{
{
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();
:rolleyes:
No prob. kung may question ka pa can PM me directly *okay*
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.
and your problem is?
just STFU if you can't be of any help instead of spewing nonsense.
wahahaha!
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