Reputation: 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?
Upvotes: -1
Views: 96
Reputation: 55601
This code sample isn't complete. It doesn't show the implementation of the SetName and GetName methods.
Upvotes: 0