From 850d95aaed0c2f31b33e951a86ce96604bdb6225 Mon Sep 17 00:00:00 2001 From: d3marco31 Date: Mon, 26 Nov 2018 20:03:41 -0600 Subject: [PATCH 1/3] first enum --- Enum/Enum.csproj | 8 ++++++++ Enum/Program.cs | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Enum/Enum.csproj create mode 100644 Enum/Program.cs diff --git a/Enum/Enum.csproj b/Enum/Enum.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/Enum/Enum.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + diff --git a/Enum/Program.cs b/Enum/Program.cs new file mode 100644 index 00000000..e8d14056 --- /dev/null +++ b/Enum/Program.cs @@ -0,0 +1,22 @@ +using System; + +namespace Enum +{ + enum PrimaryColors + { + RED, BLUE, YELLOW + } + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello Enum!"); + string primaryCombined = combinePrimaryColors(PrimaryColors.RED, PrimaryColors.YELLOW); + Console.WriteLine("Red + Yellow = "+primaryCombined); + } + public static String combinePrimaryColors(PrimaryColors color1, PrimaryColors color2) + { + + } + } +} From 7ea08fc33da22583180fa6f90ad95682eb1163d2 Mon Sep 17 00:00:00 2001 From: d3marco31 Date: Mon, 3 Dec 2018 10:50:27 -0600 Subject: [PATCH 2/3] enum --- Enum/Program.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Enum/Program.cs b/Enum/Program.cs index e8d14056..c7597793 100644 --- a/Enum/Program.cs +++ b/Enum/Program.cs @@ -2,21 +2,25 @@ namespace Enum { - enum PrimaryColors + enum WeekDays { - RED, BLUE, YELLOW + MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY } class Program { static void Main(string[] args) { - Console.WriteLine("Hello Enum!"); - string primaryCombined = combinePrimaryColors(PrimaryColors.RED, PrimaryColors.YELLOW); - Console.WriteLine("Red + Yellow = "+primaryCombined); + Console.WriteLine("When is your birthday?"); + string birthDay = Console.ReadLine(); + // Console.WriteLine("Red + Yellow = "+primaryCombined); } - public static String combinePrimaryColors(PrimaryColors color1, PrimaryColors color2) + public static string Age(this HtmlHelper helper, DateTime birthday) { - + DateTime now = DateTime.Today; + int age = now.Year - birthday.Year; + if (now < birthday.AddYears(age)) age--; + + return age.ToString(); } } } From 1fe3d16d82b0d36cdc66bbd2924b4a2e2077e833 Mon Sep 17 00:00:00 2001 From: d3marco31 Date: Sun, 9 Dec 2018 21:29:34 -0600 Subject: [PATCH 3/3] Enum assignment --- Checkpoint3/Checkpoint3.csproj | 8 ++++++ Checkpoint3/Program.cs | 12 +++++++++ Enum/Program.cs | 46 ++++++++++++++++------------------ Files/Files.cs | 8 +++++- 4 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 Checkpoint3/Checkpoint3.csproj create mode 100644 Checkpoint3/Program.cs diff --git a/Checkpoint3/Checkpoint3.csproj b/Checkpoint3/Checkpoint3.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/Checkpoint3/Checkpoint3.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + diff --git a/Checkpoint3/Program.cs b/Checkpoint3/Program.cs new file mode 100644 index 00000000..4ef4ae90 --- /dev/null +++ b/Checkpoint3/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace Checkpoint3 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/Enum/Program.cs b/Enum/Program.cs index c7597793..656c0c74 100644 --- a/Enum/Program.cs +++ b/Enum/Program.cs @@ -1,26 +1,22 @@ -using System; - -namespace Enum + +using System; + +public class Program { - enum WeekDays - { - MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY - } - class Program - { - static void Main(string[] args) - { - Console.WriteLine("When is your birthday?"); - string birthDay = Console.ReadLine(); - // Console.WriteLine("Red + Yellow = "+primaryCombined); - } - public static string Age(this HtmlHelper helper, DateTime birthday) - { - DateTime now = DateTime.Today; - int age = now.Year - birthday.Year; - if (now < birthday.AddYears(age)) age--; - - return age.ToString(); - } - } -} + public static void Main() + { + int myDay = 15; + int myMonth = 10; + + Console.WriteLine("Please input a year"); + int myYear = Convert.ToInt32(Console.ReadLine()); + DateTime dt = new DateTime(myYear,myMonth, myDay); + int dow = (int)dt.DayOfWeek; + var dowName = (DaysOfTheWeekWithNumbers)dow; + Console.WriteLine(dowName); + } + enum DaysOfTheWeekWithNumbers + { + Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 0 + } +} \ No newline at end of file diff --git a/Files/Files.cs b/Files/Files.cs index da1ebc78..506c7605 100644 --- a/Files/Files.cs +++ b/Files/Files.cs @@ -1,4 +1,5 @@ using System; +using System.IO; namespace Files { @@ -6,7 +7,12 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("This is a file"); } + static void CreateFile(string filename) + { + + } + static void } }