using System.Collections.Generic;
public static void Main()
Console.WriteLine("Please enter the starting value of your gift card:");
var cardValue = double.Parse(Console.ReadLine());
var gCard = new GiftCard(cardValue);
Console.WriteLine("Would you like to enter a transaction?");
while (Console.ReadLine().ToLower() == "y" || Console.ReadLine().ToLower() == "yes")
Console.WriteLine("Please enter the amount of the transaction");
var transaction = double.Parse(Console.ReadLine());
gCard.UpdateValue(transaction);
Console.WriteLine("Your new gift card balance is: " + gCard.CurrentValue);
Console.WriteLine("Would you like to enter another transaction?");
Console.WriteLine("Thank you for playing");
public double StartValue {get; private set;}
public double CurrentValue {get; private set;}
public static List<double> Transactions = new List<double>();
public GiftCard(double startValue)
CurrentValue = startValue;
public void UpdateValue (double transaction)
CurrentValue -= transaction;
Transactions.Add(transaction);