From 2e3a60d0889b1df9bd37a96a0ab0366a5de130b9 Mon Sep 17 00:00:00 2001 From: Denysov Denys Date: Sun, 28 May 2017 17:52:08 +0300 Subject: [PATCH 1/3] Iteration for --- CSahrp/for.cs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CSahrp/for.cs diff --git a/CSahrp/for.cs b/CSahrp/for.cs new file mode 100644 index 0000000..3c0a57e --- /dev/null +++ b/CSahrp/for.cs @@ -0,0 +1,3 @@ +for (let i = 0; i < 10; i++) { + console.log(i); +} \ No newline at end of file From b775149d997f219fb00012e0e9d8fab5d1186203 Mon Sep 17 00:00:00 2001 From: Denysov Denys Date: Sun, 28 May 2017 17:53:57 +0300 Subject: [PATCH 2/3] Iteration for --- CSahrp/for.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CSahrp/for.cs b/CSahrp/for.cs index 3c0a57e..08545cb 100644 --- a/CSahrp/for.cs +++ b/CSahrp/for.cs @@ -1,3 +1,10 @@ -for (let i = 0; i < 10; i++) { - console.log(i); +class FOR +{ + public FOR() + { + for (let i = 0; i < 10; i++) + { + Console.WriteLine(log(i)); + } + } } \ No newline at end of file From 2648e62943c1a5b38283725bf740e91be585f60c Mon Sep 17 00:00:00 2001 From: Denysov Denys Date: Sun, 28 May 2017 18:43:32 +0300 Subject: [PATCH 3/3] All Iterations --- CSahrp/break.cs | 10 ++++++++++ CSahrp/continue.cs | 10 ++++++++++ CSahrp/doWhile.cs | 11 +++++++++++ CSahrp/forEach.cs | 9 +++++++++ CSahrp/goto.cs | 26 ++++++++++++++++++++++++++ CSahrp/while.cs | 11 +++++++++++ 6 files changed, 77 insertions(+) create mode 100644 CSahrp/break.cs create mode 100644 CSahrp/continue.cs create mode 100644 CSahrp/doWhile.cs create mode 100644 CSahrp/forEach.cs create mode 100644 CSahrp/goto.cs create mode 100644 CSahrp/while.cs diff --git a/CSahrp/break.cs b/CSahrp/break.cs new file mode 100644 index 0000000..2450e2b --- /dev/null +++ b/CSahrp/break.cs @@ -0,0 +1,10 @@ +class BREAK +{ + public BREAK() + { + const bool flag = true; + Console.WriteLine("Hello"); + if (flag) break; + Console.WriteLine("World"); + } +} \ No newline at end of file diff --git a/CSahrp/continue.cs b/CSahrp/continue.cs new file mode 100644 index 0000000..e71145a --- /dev/null +++ b/CSahrp/continue.cs @@ -0,0 +1,10 @@ +class BREAK +{ + public BREAK() + { + const bool flag = true; + Console.WriteLine("Hello"); + if (flag) continue; + Console.WriteLine("World"); + } +} \ No newline at end of file diff --git a/CSahrp/doWhile.cs b/CSahrp/doWhile.cs new file mode 100644 index 0000000..3003ce0 --- /dev/null +++ b/CSahrp/doWhile.cs @@ -0,0 +1,11 @@ +class WHILE +{ + public WHILE() + { + int i = 0; + do + { + Console.WriteLine(i++); + } while (i < 10); + } +} \ No newline at end of file diff --git a/CSahrp/forEach.cs b/CSahrp/forEach.cs new file mode 100644 index 0000000..c85daf0 --- /dev/null +++ b/CSahrp/forEach.cs @@ -0,0 +1,9 @@ +class FOREACH +{ + public FOREACH() + { + const int a = { 7, 10, 1, 5, 2 }; + foreach (int i in b) + Console.WriteLine(i); + } +} \ No newline at end of file diff --git a/CSahrp/goto.cs b/CSahrp/goto.cs new file mode 100644 index 0000000..ad96322 --- /dev/null +++ b/CSahrp/goto.cs @@ -0,0 +1,26 @@ +class GOTO +{ + public GOTO() + { + Console.WriteLine("Coffee sizes: 1=Small 2=Medium 3=Large"); + Console.Write("Please enter your selection: "); + string s = Console.ReadLine(); + int n = int.Parse(s); + int cost = 0; + switch (n) + { + case 1: + cost += 25; + break; + case 2: + cost += 25; + goto case 1; + case 3: + cost += 50; + goto case 1; + default: + Console.WriteLine("Invalid selection."); + break; + } + } +} \ No newline at end of file diff --git a/CSahrp/while.cs b/CSahrp/while.cs new file mode 100644 index 0000000..81e408b --- /dev/null +++ b/CSahrp/while.cs @@ -0,0 +1,11 @@ +class WHILE +{ + public WHILE() + { + int a = 0; + while (a < 10) + { + Console.WriteLine(a++); + } + } +} \ No newline at end of file