Answer to Question #200416 in C# for Wise Tshikovhela

Question #200416

Write a user defined method named displayDetails() that declared and assigns values to local variables for your nick name, your student number, and your favourite movie. The method should also contain 3 WriteLine statements to display your nick name, your student number, and your favourite movie. Write a program that displays the text Hello World and then calls the displayDetails() method to display your information


1
Expert's answer
2021-05-30T07:23:54-0400
using System;

namespace Test
{
    class DisplayTest
    {
        static void displayDetails()
        {
            Console.Write("Enter your nick name:      ");
            string nickName = Console.ReadLine();
            Console.Write("Enter your student number: ");
            string studentNumber = Console.ReadLine();
            Console.Write("Enter your favorite movie: ");
            string favoriteMovie = Console.ReadLine();

            Console.WriteLine("\n" + nickName);
            Console.WriteLine(studentNumber);
            Console.WriteLine(favoriteMovie);
        }

        static int Main()
        {
            Console.WriteLine("Hello World\n");
            displayDetails();
            return 0;
        }
    }
}

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