-
Notifications
You must be signed in to change notification settings - Fork 0
/
Session_2.cs
80 lines (63 loc) · 1.74 KB
/
Session_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
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
using System;
namespace Session_2
{
class Program
{
static void Main(string[] args)
{
Clock myClock = new Clock();
var input = myClock.Menu();
myClock.Case(input);
}
}
public class Clock
{
public int Hour { get; set; }
public int Minute { get; set; }
public int Second { get; set; }
public int HourToMinute(int hour)
{
Hour = hour;
int result;
return result = Hour * 60;
}
public int MinuteToSecond(int minute)
{
Minute = minute;
return Minute * 60;
}
// public void SecToHour()
// {
// var h = Math.(Second / 3600);
// var b = Second % 3600;
// var m = Math.Floor(b / 60);
// var s = b % 60;
// Console.WriteLine($"{h}h {m}min {s}sec");
// }
public string Menu()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Clock Converter");
Console.ResetColor();
Console.WriteLine("#1 Hour to minute");
Console.WriteLine("#2 Minute to second");
// Console.WriteLine("#3 Hour to minute");
Console.WriteLine("Enter the options");
string input = Console.ReadLine();
return input;
}
public void Case(string input)
{
switch (input)
{
case "1":
Console.WriteLine("1");
break;
case "2":
Console.WriteLine("2");
break;
}
}
}
}