-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCables.cs
52 lines (43 loc) · 1.23 KB
/
Cables.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FinalProject
{
internal class Cables : Part
{
// Private fields
private string type = "";
private int length = 0;
private string connectorType = "";
// Properties with data validation
public string Type
{
get { return type; }
set { type = value; }
}
public string ConnectorType
{
get { return connectorType; }
set { connectorType = value; }
}
public int Length
{
get { return length; }
set { length = value; }
}
// Constructor
public Cables(string t, string ct, int l, string v, float p, string ma, string mo, string c) : base(v, p, ma, mo, c)
{
Type = t;
ConnectorType = ct;
Length = l;
}
// Overrides base class display method
public override string getData()
{
return "Cable," + base.getData() + ",Type of Cable: " + Type + " Connector Type: " + ConnectorType + " Length: " + Length + " m";
}
}
}