0% found this document useful (0 votes)
26 views5 pages

MYASS

The document defines a ShoeMaker class that manages the creation and listing of different shoe types. It contains methods to add rubber shoes, running shoes, and black shoes to their respective lists. These methods prompt the user for shoe details. There are also methods to display a list of shoes or select an option to create or list shoes. Default shoe objects are initialized to populate the lists. Classes like RubberShoes inherit from the Shoes base class.

Uploaded by

Kyla Barribal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

MYASS

The document defines a ShoeMaker class that manages the creation and listing of different shoe types. It contains methods to add rubber shoes, running shoes, and black shoes to their respective lists. These methods prompt the user for shoe details. There are also methods to display a list of shoes or select an option to create or list shoes. Default shoe objects are initialized to populate the lists. Classes like RubberShoes inherit from the Shoes base class.

Uploaded by

Kyla Barribal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

using System.

Drawing;

public class ShoeMaker {


private int shoeId;
private double shoeSize;
private string shoeBrand = "";
private string shoeDesign = "";
private string shoePattern = "";
public static List<ShoeMaker> RunningShoesList = new List<ShoeMaker>();
public static List<ShoeMaker> RubberShoesList = new List<ShoeMaker>();
public static List<ShoeMaker> BlackShoesList = new List<ShoeMaker>();
public static List<ShoeMaker> ShoeList = new List<ShoeMaker>();
public static void Main(String[] args) {

Console.WriteLine("Welcome to Shoe Maker!");


AddDefault();
Selection();

}
public static void Selection()
{
Console.WriteLine("What do you want to do?\nA. Create a Shoe\nB. List of
All");
string select = Console.ReadLine().ToUpper();
switch (select)
{
case "A":
ShoeCreation();
Selection();
break;
case "B":
ListOfShoes();
Selection();
break;
default:
Console.WriteLine("Invalid input");
Selection();
break;
}
}
public static void ShoeCreation()
{
Console.WriteLine("What Shoe do you want?\nA. Rubber Shoes\nB. Running
Shoes\nC. Black Shoes");
string babySelction = Console.ReadLine().ToUpper();
switch (babySelction)
{
case "A":
AddRubberShoes();
break;
case "B":
AddRunningShoes();
break;
case "C":
AddBlackShoes();
break;
default:
Console.WriteLine("Invalid Input!");
ShoeCreation();
break;
}
}
public static void AddRubberShoes()
{
int idShoe = RubberShoesList.Count + 1;
Console.WriteLine("Shoe Size: ");
double size = 0;
double.TryParse(Console.ReadLine(), out size);
Console.WriteLine("Shoe Design: ");
string design = Console.ReadLine();
if (string.IsNullOrWhiteSpace(design))
{
design = "NO DESIGN";
}

ShoeMaker defaultOrder = new ShoeMaker


{
shoeId = idShoe,
shoeSize = size,
shoePattern = design
};
RubberShoesList.Add(defaultOrder);
ShoeList.Add(defaultOrder);
Console.WriteLine("Shoe Added!");
Console.WriteLine($"Your new ID is {idShoe}");
}
public static void AddRunningShoes() {
int idShoe = RunningShoesList.Count + 1;
Console.WriteLine("Shoe Size: ");
double size = 0;
double.TryParse(Console.ReadLine(), out size);
Console.WriteLine("Shoe Pattern: ");
string pattern = Console.ReadLine();
if (string.IsNullOrWhiteSpace(pattern))
{
pattern = "NO PATTERN";
}

ShoeMaker defaultOrder = new ShoeMaker


{
shoeId = idShoe,
shoeSize = size,
shoePattern = pattern
};

RunningShoesList.Add(defaultOrder);
ShoeList.Add(defaultOrder);
Console.WriteLine("Shoe Added!");
Console.WriteLine($"Your new ID is {idShoe}");
}
public static void AddBlackShoes()
{

int idShoe = RunningShoesList.Count + 1;


Console.WriteLine("Shoe Size: ");
double size = 0;
double.TryParse(Console.ReadLine(), out size);
Console.WriteLine("Shoe Brand: ");
string brand = Console.ReadLine();
if (string.IsNullOrWhiteSpace(brand))
{
brand = "NO BRAND";
}

ShoeMaker defaultOrder = new ShoeMaker


{
shoeId = idShoe,
shoeSize = size,
shoePattern = brand
};

BlackShoesList.Add(defaultOrder);
ShoeList.Add(defaultOrder);
Console.WriteLine("Shoe Added!");
Console.WriteLine($"Your new ID is {idShoe}");
}
public static void ListOfShoes()
{
if (RunningShoesList.Count >= 1)
{
Console.WriteLine();
Console.WriteLine("List of Shoes:");
Console.WriteLine();
foreach (ShoeMaker shoes in RunningShoesList)
{
Console.WriteLine("Shoe ID: " + shoes.shoeId);
Console.WriteLine("Shoe Type: Running Shoes");
Console.WriteLine("Shoe Size: " + shoes.shoeSize);
Console.WriteLine("Shoe Pattern: " + shoes.shoePattern);
Console.WriteLine();
}
}
if (RubberShoesList.Count >= 1)
{
Console.WriteLine();
foreach (ShoeMaker shoes in RubberShoesList)
{
Console.WriteLine("Shoe ID: " + shoes.shoeId);
Console.WriteLine("Shoe Type: Rubber Shoes");
Console.WriteLine("Shoe Size: " + shoes.shoeSize);
Console.WriteLine("Shoe Design: " + shoes.shoeDesign);
Console.WriteLine();
}
}
if (BlackShoesList.Count >= 1)
{
Console.WriteLine();
foreach (ShoeMaker shoes in RunningShoesList)
{
Console.WriteLine("Shoe ID: " + shoes.shoeId);
Console.WriteLine("Shoe Type: Black Shoes");
Console.WriteLine("Shoe Size: " + shoes.shoeSize);
Console.WriteLine("Shoe Brand: " + shoes.shoeBrand);
Console.WriteLine();
}
}
else
{
Console.WriteLine("No orders found.");
}
}
public static void AddDefault() {
int idShoeRn = RunningShoesList.Count + 1;
string rnType = "Running Shoes";
double rnSize = 42;
string rnPattern = "Plain";

ShoeMaker defaultOrder = new ShoeMaker


{
shoeId = idShoeRn,

shoeSize = rnSize,
shoePattern = rnPattern
};

RunningShoesList.Add(defaultOrder);
ShoeList.Add(defaultOrder);

int idShoeRb = RubberShoesList.Count + 1;


string rbType = "Rubber Shoes";
double rbSize = 42;
string rbDesign = "Minimal";
ShoeMaker defaultOrder1 = new ShoeMaker
{
shoeId = idShoeRb,

shoeSize = rbSize,
shoeDesign = rbDesign
};

RubberShoesList.Add(defaultOrder1);
ShoeList.Add(defaultOrder1);
int idShoeBlck = BlackShoesList.Count + 1;
string blckType = "Black Shoes";
double blckSize = 45;
string blckBrand = "Lacoste";
ShoeMaker defaultOrder2 = new ShoeMaker
{
shoeId = idShoeBlck,
shoeSize = blckSize,
shoeBrand = blckBrand
};

BlackShoesList.Add(defaultOrder2);
ShoeList.Add(defaultOrder2);
}
}

public class Shoes {


private static int id = 1;
protected int nextId { get; }
}

public class RubberShoes : Shoes


{ //Derived Class
private int ShoeId { get; }
private static int id = 1;
private string ShoeDesign { get; }
private int ShoeSize { get; }
public RubberShoes(int shoeId, string shoeDesign, int shoeSize)
{
ShoeId = shoeId;
ShoeDesign = shoeDesign;
ShoeSize = shoeSize;

public class RunningShoes : Shoes


{ //Derived Class
private int ShoeId { get; }
private static int id = 1;
private int ShoeSize { get; }
private string ShoePattern { get; }
public RunningShoes(int shoeId, string shoePattern, int shoeSize)
{
ShoeId = shoeId;
ShoePattern = shoePattern;
ShoeSize = shoeSize;
}
}

public class BlackShoes : Shoes


{ //Derived Class
private int ShoeId { get; }
private static int id = 1;
private string ShoeBrand { get; }
private int ShoeSize { get; }
public BlackShoes(int shoeId, string shoeBrand, int shoeSize)
{
ShoeId = shoeId;
ShoeBrand = shoeBrand;
ShoeSize = shoeSize;
}
}

You might also like