using System.Collections.Generic;
using System.Threading.Tasks;
using System.Xml.Serialization;
static void Main(string[] args)
Scrapbook scrapbook = new Scrapbook();
Console.Write("1. Orchid (3 petals)\n2. Baby's breath (5 petals)\n3. Daisy (15 petals)\n4. Rose (30 petals)\n5. Exit\nEnter the number of which flower you'd like to add to the scrapbook or 5 to exit: ");
bool valid = int.TryParse(Console.ReadLine(), out int choice);
Console.WriteLine("Enter a valid choice");
Console.Write("How many would you like to add?: ");
bool valid2 = int.TryParse(Console.ReadLine(), out int count);
if (!valid2 || count < 1) {
Console.WriteLine("Enter a valid number");
scrapbook.AddPetal(new Orchid(count));
scrapbook.AddPetal(new BabysBreath(count));
scrapbook.AddPetal(new Daisy(count));
scrapbook.AddPetal(new Rose(count));
Console.WriteLine("Enter a valid choice");
int total = scrapbook.GetPetalNum();
Console.WriteLine($"Total petals in scrapbook: {total}\n");
Console.WriteLine("Thank you for scrapbooking!");
public abstract class Flower
public abstract int GetPetals();
public class Orchid : Flower
public override int GetPetals()
public class BabysBreath : Flower
public BabysBreath(int count)
public override int GetPetals()
public class Daisy : Flower
public override int GetPetals()
public class Rose : Flower
public override int GetPetals()
protected List<Flower> Flowers = new List<Flower>();
public void AddPetal(Flower flower)
for(int i = 0; i < Flowers.Count; i++)
total += Flowers[i].GetPetals();