-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenum_2.cs
38 lines (31 loc) · 811 Bytes
/
enum_2.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
using System;
class Program
{
static void Main(string[] args)
{
Control obj = new Control();
obj.converyor(Control.Action.start);
obj.converyor(Control.Action.reverse);
Console.ReadLine();
}
}
class Control
{
public enum Action {start, stop, forward, reverse };
public void converyor(Action a){
switch (a){
case Action.start:
Console.WriteLine("Starting");
break;
case Action.stop:
Console.WriteLine("Stopping");
break;
case Action.forward:
Console.WriteLine("Moving forward");
break;
case Action.reverse:
Console.WriteLine("Moving backward");
break;
}
}
}