Answer to Question #328585 in C# for Siyanda

Question #328585

Create a new project, and copy your

code from Task 1 to the new project

(copy the contents of the Main()

method and the displayDetails()

method)

Adapt your Main() method to capture

and display the details for 4 different

people.

The displayDetails() method

should remain unchanged.


1
Expert's answer
2022-04-14T15:38:25-0400
internal class Program
{ 
    static void Main()
    {
        Console.WriteLine("Hello world");


        for (int i = 0; i < 4; i++)
        {
            Console.WriteLine($"Enter data for {i+1} person");


            Console.Write("Enter nickname: ");
            string nickname = Console.ReadLine();


            Console.Write("Enter favourite movie/series: ");
            string favouriteMovie = Console.ReadLine();


            displayDetails(nickname, favouriteMovie);
            Console.WriteLine();
        }
        Console.ReadKey();
    }
    static void displayDetails(string nickname, string favouriteMovie)
    {
        Console.WriteLine($"Your nickname {nickname}, and favorite series/movie: {favouriteMovie}");
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS