-1

Code should get user to input first & last name.

using System;

namespace CSCI_231_Week3_Assn_8
{
    class AccountTest
    {
       static void Main()
       {
          // Create an Account object and assign it to myAccount
          AccountTest myAccount = new AccountTest();

          // Display myAccount's initial name
          Console.WriteLine($"Initial name is: {myAccount.GetName()}");
          // Prompt for and read the name (First & Last) then put the name in the object
          Console.Write("Enter your First & Last name: "); // Propts user to enter their first & last 
          name
          string userName = Console.ReadLine(); // Reads the first & last name entered by user
          myAccount.SetName(userName); // put userName in the myAccount object

          // Display the name stored in the myAccount object
          Console.WriteLine($"myAccount's name is: {myAccount.GetName()}");
       }
    }
 }

So I have missed something but am lost as to what?

Dragonthoughts
  • 2,180
  • 8
  • 25
  • 28
  • What programming language are you using? I'm guessing C#. I'll tag your question with C#, if I'm wrong, then please correct the tag. – Dragonthoughts Jan 27 '20 at 08:30

1 Answers1

0

This code sample isn't complete. It doesn't show the implementation of the SetName and GetName methods.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100