-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCPU.cs
56 lines (50 loc) · 1.37 KB
/
CPU.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FinalProject
{
internal class CPU : Part
{
//private data feilds
private String socketType;
private int coreCount;
float clockSpeed;
//public constructors
public CPU() : base()
{
socketType = "";
coreCount = 0;
clockSpeed = 0;
}
//overloaded constuctor
public CPU(string st, int cc, float cs, string v, float p, string m, string mk, string c) : base(v, p, m, mk, c)
{
socketType = st;
coreCount = cc;
clockSpeed = cs;
}
//public properties
public string SocketType
{
get { return socketType; }
set { socketType = value; }
}
public int CoreCount
{
get { return coreCount; }
set { coreCount = value; }
}
public float ClockSpeed
{
get { return clockSpeed; }
set { clockSpeed = value; }
}
//overide method
public override string getData()
{
return "CPU," + base.getData() + ",Socket Type: " + SocketType + " Core Count: " + CoreCount.ToString() + " Clock Speed: " + ClockSpeed.ToString();
}
}
}