Question: Prior to making any other changes, set a breakpoint set on line 26 in driver class Add the appropriate comments (both .cs files) Add code

Prior to making any other changes, set a breakpoint set on line 26 in driver class
  • Add the appropriate comments (both .cs files)
  • Add code for prompt and pause logic (driver class also known as AccountTest.cs)
  • The application should have 3 accounts - add Guest with name = [your name], 0 balance (driver class) - don't forget additional attributes below
  • Accounts should be updated to have 4 properties/attributes: Name, Balance (existing), UserName & Pin need to be added - type string (account class). Need to pass additional parameters to initialize new attributes (user1, 1234/user2, 4321/guest,0000 )
  • Add Properties logic to allow get/set the additional properties (account class)
  • // Fig. 4.12: AccountTest.cs // Reading and writing monetary amounts with Account objects. using System;

    class AccountTest { static void Main() { Account account1 = new Account("Jane Green", 50.00m); Account account2 = new Account("John Blue", -7.53m);

    // display initial balance of each object Console.WriteLine($"{account1.Name}'s balance: {account1.Balance:C}"); Console.WriteLine($"{account2.Name}'s balance: {account2.Balance:C}");

    // prompt for then read input Console.Write(" Enter deposit amount for account1: "); decimal depositAmount = decimal.Parse(Console.ReadLine()); Console.WriteLine($"adding {depositAmount:C} to account1 balance "); account1.Deposit(depositAmount); // add to account1's balance

    // display balances Console.WriteLine( $"{account1.Name}'s balance: {account1.Balance:C}"); Console.WriteLine( $"{account2.Name}'s balance: {account2.Balance:C}");

    // prompt for then read input Console.Write(" Enter deposit amount for account2: "); depositAmount = decimal.Parse(Console.ReadLine()); Console.WriteLine( $"adding {depositAmount:C} to account2 balance "); account2.Deposit(depositAmount); // add to account2's balance

    // display balances Console.WriteLine($"{account1.Name}'s balance: {account1.Balance:C}"); Console.WriteLine($"{account2.Name}'s balance: {account2.Balance:C}"); } }

    Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Programming Questions!