From 6fb243b099492e9d7f43a39b06e31f116282fd85 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Tue, 2 Apr 2019 19:02:15 -0500 Subject: [PATCH 1/8] hello world commit 1 --- HelloWorld/HelloWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index 8168c805..ebf34321 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -6,7 +6,7 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("Hello Chase!"); } } } From 47a72e76a7492b65a681a7120502b32e68183715 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Tue, 2 Apr 2019 19:09:22 -0500 Subject: [PATCH 2/8] changed back to normal --- HelloWorld/HelloWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HelloWorld/HelloWorld.cs b/HelloWorld/HelloWorld.cs index ebf34321..8168c805 100644 --- a/HelloWorld/HelloWorld.cs +++ b/HelloWorld/HelloWorld.cs @@ -6,7 +6,7 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello Chase!"); + Console.WriteLine("Hello World!"); } } } From b6b854de27028c1e551b2e84f7103a00a3c9448d Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Thu, 2 May 2019 20:16:41 -0500 Subject: [PATCH 3/8] just committing some class work to look at later --- OOP2/OOP2.csproj | 8 ++++++++ OOP2/Program.cs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 OOP2/OOP2.csproj create mode 100644 OOP2/Program.cs diff --git a/OOP2/OOP2.csproj b/OOP2/OOP2.csproj new file mode 100644 index 00000000..21dff5ca --- /dev/null +++ b/OOP2/OOP2.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.2 + + + diff --git a/OOP2/Program.cs b/OOP2/Program.cs new file mode 100644 index 00000000..1e736419 --- /dev/null +++ b/OOP2/Program.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace OOP2 +{ + class Program + { + static void Main(string[] args) + { + _2DPoint p1 = new _2DPoint(3,4); + _3DPoint p2 = new _3DPoint(6,2,8); + + Console.WriteLine("p1 = {0}", p1.ToString()); + Console.WriteLine("p2 = {0}", p2.ToString()); + + } + } + + + public class _2DPoint + { + public int x; + public int y; + + public _2DPoint(int initialX, int initialY){ + this.x = initialX; + this.y = initialY; + + } + public String ToString(){ + String s = String.Format("{0} , {1}", x, y); + return s; + } + } + public class _3DPoint : _2DPoint + { + public int z; + public _3DPoint(int initialX, int initialY, int initialZ) : + base ( initialX, initialY){ + this.x = initialX; + this.y = initialY; + this.z = initialZ; + } + } + +} \ No newline at end of file From 44647b2b7f115ab7a19bbb0a8a5ea34b6cdd2881 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Thu, 2 May 2019 20:38:01 -0500 Subject: [PATCH 4/8] commiting work from class for future reference --- OOP2/Program.cs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/OOP2/Program.cs b/OOP2/Program.cs index 1e736419..df8392e6 100644 --- a/OOP2/Program.cs +++ b/OOP2/Program.cs @@ -9,9 +9,12 @@ static void Main(string[] args) { _2DPoint p1 = new _2DPoint(3,4); _3DPoint p2 = new _3DPoint(6,2,8); + _2DPoint p3 = new _2DPoint(3,4); - Console.WriteLine("p1 = {0}", p1.ToString()); - Console.WriteLine("p2 = {0}", p2.ToString()); + Console.WriteLine("p1 = {0}", p1); + Console.WriteLine("p2 = {0}", p2); + + } } @@ -27,10 +30,21 @@ public _2DPoint(int initialX, int initialY){ this.y = initialY; } + override public String ToString(){ String s = String.Format("{0} , {1}", x, y); return s; } + override + public bool Equals(Object otherObject){ + _2DPoint otherpoint = (_2DPoint) otherObject; + if(this.x == otherpoint.x && this.y == otherpoint.y ){ + return true; + } + else{ + return false; + } + } } public class _3DPoint : _2DPoint { @@ -41,6 +55,13 @@ public _3DPoint(int initialX, int initialY, int initialZ) : this.y = initialY; this.z = initialZ; } + override + public String ToString() + { + String s = String.Format("{0}, {1}, {2},", x, y, z); + return s; + } + } + } -} \ No newline at end of file From 59679922e72f53711af8b4baf8157f46b6153bf4 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Tue, 14 May 2019 20:51:15 -0500 Subject: [PATCH 5/8] CarLot almost there --- CarLot/CarLot.csproj | 8 +++++ CarLot/Program.cs | 86 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 CarLot/CarLot.csproj create mode 100644 CarLot/Program.cs diff --git a/CarLot/CarLot.csproj b/CarLot/CarLot.csproj new file mode 100644 index 00000000..21dff5ca --- /dev/null +++ b/CarLot/CarLot.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.2 + + + diff --git a/CarLot/Program.cs b/CarLot/Program.cs new file mode 100644 index 00000000..3b883904 --- /dev/null +++ b/CarLot/Program.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; + +namespace OOP3 +{ + + public class Program { + + public static void Main(String[] args) + { + CarLot CL1 = new CarLot("Chase's Cars"); + Car mazda = new Car("White", "Mazda", "3", "Hatchback"); + Car subaru = new Car("Black", "Subaru", "Impreza", "Sedan"); + Truck f150 = new Truck("Red", "Ford", "F-150", 5); + CL1.Add(mazda); + CL1.Add(subaru); + CL1.Add(f150); + + CL1.PrintInventory(); + + } + + } + + public class CarLot { + List inventory; + String name; + + public CarLot(string intialName){ + this.name = intialName; + + } + + public void Add(Vehicle vehicle){ + //code goes here + } + + public void PrintInventory(){ + foreach(var vehicle in inventory){ + + } + } + } + + public abstract class Vehicle { + + string color; + string make; + string model; + + public Vehicle(string intialColor, string intialMake, string intialModel){ + this.color = intialColor; + this.make = intialMake; + this.model = intialModel; + } + + override + public String ToString(){ + String s = ""; + return s; + } + + } + + public class Car : Vehicle{ + + string bodyType; + + public Car(string initialColor, string initialMake, string intialModel, string intialBodyType) : + base(initialColor, initialMake, intialModel ){ + this.bodyType = intialBodyType; + + } + + } + + public class Truck : Vehicle { + + int cabSize; + + public Truck(string intialColor, string initialMake, string intialModel, int initialCabSize) : + base(intialColor, initialMake, intialModel){ + this.cabSize = initialCabSize; + } + } +} \ No newline at end of file From 27176e38b483599f75873f410f0b39bc422b86a2 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Thu, 16 May 2019 17:08:43 -0500 Subject: [PATCH 6/8] more Carlot finished --- CarLot/Program.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/CarLot/Program.cs b/CarLot/Program.cs index 3b883904..54e5a173 100644 --- a/CarLot/Program.cs +++ b/CarLot/Program.cs @@ -11,7 +11,11 @@ public static void Main(String[] args) CarLot CL1 = new CarLot("Chase's Cars"); Car mazda = new Car("White", "Mazda", "3", "Hatchback"); Car subaru = new Car("Black", "Subaru", "Impreza", "Sedan"); + Car chevy = new Car("Silver", "Chevy", "Malibu", "Sedan"); + Car toyota = new Car("Green", "Toyota", "Celica", "Coupe"); Truck f150 = new Truck("Red", "Ford", "F-150", 5); + Truck titan = new Truck("Gray","Nissan","Titan", 5); + Truck ram = new Truck("Black", "Dodge", "Ram", 6); CL1.Add(mazda); CL1.Add(subaru); CL1.Add(f150); @@ -27,8 +31,7 @@ public class CarLot { String name; public CarLot(string intialName){ - this.name = intialName; - + this.name = intialName; } public void Add(Vehicle vehicle){ @@ -37,7 +40,7 @@ public void Add(Vehicle vehicle){ public void PrintInventory(){ foreach(var vehicle in inventory){ - + Console.WriteLine(vehicle); } } } @@ -56,7 +59,7 @@ public Vehicle(string intialColor, string intialMake, string intialModel){ override public String ToString(){ - String s = ""; + String s = string.Format(this.color + "" + this.make + "" + this.model + ""); return s; } @@ -72,6 +75,12 @@ public Car(string initialColor, string initialMake, string intialModel, string i } + override + public String ToString(){ + String s = string.Format(this.bodyType); + return s; + } + } public class Truck : Vehicle { From 008104d7e60a22930d1ad60c3086121c62b38122 Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Thu, 16 May 2019 17:24:31 -0500 Subject: [PATCH 7/8] more carlot work --- CarLot/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CarLot/Program.cs b/CarLot/Program.cs index 54e5a173..a6e3b0ed 100644 --- a/CarLot/Program.cs +++ b/CarLot/Program.cs @@ -59,8 +59,8 @@ public Vehicle(string intialColor, string intialMake, string intialModel){ override public String ToString(){ - String s = string.Format(this.color + "" + this.make + "" + this.model + ""); - return s; + String s1 = string.Format(this.color + "" + this.make + "" + this.model + ""); + return s1; } } @@ -77,8 +77,8 @@ public Car(string initialColor, string initialMake, string intialModel, string i override public String ToString(){ - String s = string.Format(this.bodyType); - return s; + String s2 = string.Format(this.bodyType); + return s2; } } From 2b49122499d9c662a50cb2e3574e917c2a35d09b Mon Sep 17 00:00:00 2001 From: ChaseWoods89 Date: Tue, 21 May 2019 12:47:51 -0500 Subject: [PATCH 8/8] Almost finished, cannot figure out what is going wrong --- CarLot/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CarLot/Program.cs b/CarLot/Program.cs index a6e3b0ed..30f72b9b 100644 --- a/CarLot/Program.cs +++ b/CarLot/Program.cs @@ -9,6 +9,7 @@ public class Program { public static void Main(String[] args) { CarLot CL1 = new CarLot("Chase's Cars"); + CarLot CL2 = new CarLot("Other guys' Cars"); Car mazda = new Car("White", "Mazda", "3", "Hatchback"); Car subaru = new Car("Black", "Subaru", "Impreza", "Sedan"); Car chevy = new Car("Silver", "Chevy", "Malibu", "Sedan"); @@ -19,8 +20,12 @@ public static void Main(String[] args) CL1.Add(mazda); CL1.Add(subaru); CL1.Add(f150); + CL2.Add(toyota); + CL2.Add(titan); + CL2.Add(ram); CL1.PrintInventory(); + CL2.PrintInventory(); } @@ -35,12 +40,12 @@ public CarLot(string intialName){ } public void Add(Vehicle vehicle){ - //code goes here + inventory.Add(vehicle); } public void PrintInventory(){ foreach(var vehicle in inventory){ - Console.WriteLine(vehicle); + Console.WriteLine(vehicle.ToString()); } } }