-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCounting Days of the Week and Today is Tuesday, what day it would be 45 days from now.cs
More file actions
92 lines (83 loc) · 2.73 KB
/
Copy pathCounting Days of the Week and Today is Tuesday, what day it would be 45 days from now.cs
File metadata and controls
92 lines (83 loc) · 2.73 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Counting Days of the Week");
Console.WriteLine("Enter the day and its number too");
string Today =Console.ReadLine();
int day_val = Convert.ToInt32(Console.ReadLine());
int week, noof_days,day=0,Exact_day=0;
week = day_val / 7;
noof_days = day_val % 7;
switch (Today)
{
case "SUNDAY":
case "sunday":
day = 1;
break;
case "MONDAY":
case "monday":
day = 2;
break;
case "TUESDAY":
case "tuesday":
day = 3;
break;
case "WEDNESDAY":
case "wednesday":
day = 4;
break;
case "THURSDAY":
case "thursday":
day = 5;
break;
case "FRIDAY":
case "friday":
day = 6;
break;
case "SATURDAY":
case "saturday":
day =7;
break;
}
Exact_day = day + noof_days;
Console.WriteLine("Number of weeks={0} and the number of days={1}", week, noof_days);
switch (Exact_day)
{
case 0:
case 7:
Console.WriteLine("Saturday");
break;
case 1:
Console.WriteLine("Sunday");
break;
case 2:
Console.WriteLine("Monday");
break;
case 3:
Console.WriteLine("Tuesday");
break;
case 4:
Console.WriteLine("Wednesday");
break;
case 5:
Console.WriteLine("Thursday");
break;
case 6:
Console.WriteLine("Friday");
break;
default:
Console.WriteLine("nothing");
break;
}
Console.ReadLine();
}
}
}