using System.Collections.Generic;
private static List<SalesRecord> salesRecords = new();
public static void Main()
var currentServiceProvider = "AWS";
var accManager = GetAccountManager(currentServiceProvider);
Console.WriteLine("Enter User ID:");
var userId = Console.ReadLine();
Console.WriteLine("Enter Password:");
var password = Console.ReadLine();
while (!accManager.Authenticate(userId, password))
Console.WriteLine("User not found!");
Console.WriteLine("Enter User ID:");
userId = Console.ReadLine();
Console.WriteLine("Enter Password:");
password = Console.ReadLine();
for (var i = 0; i < 10000; i++)
var item = i < 4000 ? "A" : i < 8000 ? "B" : "C";
salesRecords.Add(new SalesRecord(item));
Console.WriteLine("Which item do you want to view? (A/B/C):");
var chosenItem = Console.ReadLine();
public static IAccountManager GetAccountManager(string serviceProvider)
if (serviceProvider == "AWS")
return new AzureService();
public struct SalesRecord
public string Item { get; set; }
public int Qty { get; set; }
public SalesRecord(string item)
Random rand = new Random();
public interface IAccountManager
public bool Authenticate(string userId, string password);
public class AwsService : IAccountManager
public bool Authenticate(string userId, string password)
return userId == "aws" && password == "abc123";
public bool DeleteUser(string userId)
public class AzureService : IAccountManager
public bool Authenticate(string userId, string password)
return userId == "azure" && password == "abc321";
public bool RemoveUser(string userId)