diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index 8168c805..84a82396 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -1,12 +1,35 @@ using System; -namespace HelloWorld +public class Program { - class Program + public static void Main() { - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } + string name = ""; + string lastname = ""; + int age = 0; + int year = 7; + string band = ""; + string team = ""; + + + Console.WriteLine("Please enter your first name:"); + // ReadLine enters the string + name = Console.ReadLine(); + Console.WriteLine("Please enter your last name:"); + lastname = Console.ReadLine(); + Console.WriteLine("Please enter your age:"); + // Convert.ToInt32 takes in the numbers + age = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Who is your favorite band:"); + band = Console.ReadLine(); + Console.WriteLine("What sports team do you cheer for:"); + team = Console.ReadLine(); + + + Console.WriteLine + (@"Hello! My name is {0} {1}. + I am {3} in dog years. + My favorite band is {4}. + I support {5}! ", name, lastname, age, year * age, band, team); } } diff --git a/HelloWorld1/HelloWorld1.csproj b/HelloWorld1/HelloWorld1.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/HelloWorld1/HelloWorld1.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + + diff --git a/HelloWorld1/Helloworld1.cs b/HelloWorld1/Helloworld1.cs new file mode 100644 index 00000000..c58de289 --- /dev/null +++ b/HelloWorld1/Helloworld1.cs @@ -0,0 +1,26 @@ +using System; + +namespace HelloWorld1 +{ + class Program + { + static void Main(string[] args) + { + { + string name = ""; + int age = 0; + int year = 0; + + Console.WriteLine("Please enter your name: "); + name = Console.ReadLine(); + Console.WriteLine("Please enter your age: "); + age = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Please enter the year: "); + year = Convert.ToInt32(Console.ReadLine()); + + Console.WriteLine("Hello! My name is {0} and I am {1} years old. I was born in {2}.", name, age, year-age); + + } + } + } +} \ No newline at end of file diff --git a/Quiz1/Quiz1.cs b/Quiz1/Quiz1.cs new file mode 100644 index 00000000..40b0d35d --- /dev/null +++ b/Quiz1/Quiz1.cs @@ -0,0 +1,23 @@ +using System; + +namespace Quiz1 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + Console.WriteLine("Do Console Line Notes!!!"); + Console.WriteLine("Welcome Back!"); + //use of the modules, be carefull using negatives + Console.WriteLine((7%(-3))); + Console.WriteLine((7%(3))); + + int x = 7; + int y = 7; + + Console.WriteLine(x++); + Console.WriteLine(++y); + } + } +} diff --git a/Quiz1/Quiz1.csproj b/Quiz1/Quiz1.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/Quiz1/Quiz1.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + +