i want to send the return result from the function to another function that collect them and later on print them here is waht i try:
public void CreateAccount()
{
AccountList.Add(name(), code());
}
public string Name()
{
Console.WriteLine("insert your name : ");
string name = Console.ReadLine();
return name;
}
public int Code()
{
Random rnd4 = new Random();
int fourNumbers = rnd4.Next(1000, 10000);
return fourNumbers;
}
i want to add to the list “name”+”code”. what am i missing?
What about:
I’d suggest renaming
Name()andCode()to something likePromptName()andPromptCode()so their intent is more clear.