C#/실습
10.02 컴퓨터 조립
미고렝
2019. 10. 2. 17:36
에제:
코드:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
class App
{
public App()
{
GraphicCard graphicCard1 = new GraphicCard("GT730","GAINWARD");
CPU cpu1 = new CPU("라이젠 3", "AMD");
PC pc1 = new PC("컴퓨터1", cpu1, graphicCard1);
pc1.ReadCPU();
pc1.ReadGraPhicCard();
cpu1.ReadManu();
graphicCard1.ReadManu();
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
class PC
{
public string name;
CPU cpu;
GraphicCard graphicCard;
public PC(string name, CPU cpu, GraphicCard graphicCard)
{
this.name = name;
this.cpu = cpu;
this.graphicCard = graphicCard;
Console.WriteLine(this.name + "이(가) 생성되었습니다.");
Console.WriteLine(this.name + "의 그래픽카드가 생성되었습니다.");
Console.WriteLine(this.name + "의 CPU가 생성되었습니다.");
}
public void ReadCPU()
{
}
public void ReadGraPhicCard()
{
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
class CPU
{
public string name;
public string manufacturer;
public CPU(string name, string manu)
{
this.name = name;
this.manufacturer = manu;
}
public void ReadManu()
{
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class GraphicCard
{
public string name;
public string manufacturer;
public GraphicCard(string name, string manuname)
{
this.name = name;
this.manufacturer = manuname;
}
public void ReadManu()
{
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|