-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElectronicShowroom.cs
99 lines (82 loc) · 2 KB
/
ElectronicShowroom.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SkillMineProject7.InheritenceAndPolymorphism
{
/*class ElectronicShowroom
{
static int gst = 12;
protected double price;
protected String name;
public ElectronicsEquipments(double price, String name)
{
this.price = price;
this.name = name;
}
public virtual void SaleEquipment()
{
double gstAmount = (price * ElectronicsEquipments.gst) / 100;
double netAmount = price + gstAmount;
Console.WriteLine("Name of equipment is " + name + " and its price is of Rs " + netAmount);
}
public override string ToString()
{
return $"Price Of Electronic Equiments{name}, Price{price}";
}
}
class Television : ElectronicsEquipments
{
double p;
string n;
public Television(double p, String n) : base(8, "pqr")
{
this.p = p;
this.n = n;
}
public new void SaleEquipment()
{
base.SaleEquipment();
Console.WriteLine("Requires Equipment");
}
}
class Refrigerator : ElectronicsEquipments
{
double p;
string n;
public Refrigerator(double p, String n) : base(7, "xyz")
{
}
public new void SaleEquipment()
{
SaleEquipment();
}
}
class WashingMachine : ElectronicsEquipments
{
public WashingMachine(double price, String name) : base(5, "abc")
{
this.price = price;
this.name = name;
}
protected new void SaleEquipment()
{
//SaleEquipment();
}
}
public class ElectronicShowroom
{
static void Main(string[] args)
{
*//*Console.WriteLine("Enter price of equipment: ");
int price = int.Parse(Console.ReadLine());
Console.WriteLine("Enter name of elcetronic gadget: ");
string name = "Oven";
Console.WriteLine("Name is: "+name);*//*
ElectronicsEquipments ee = new ElectronicsEquipments(5000000, "Oven");
ee.SaleEquipment();
Console.WriteLine(ee);
}
}*/
}