Answer to Question #201123 in C# for Nkhululeko Chabala

Question #201123

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-31T09:15:53-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;
using System.Data.SqlClient;


namespace Q201123
{
    class Program
    {
        /// <summary>
        /// Main method
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //Write a program that displays the text Hello World and then calls the displayDetails() method to display your information.
            Console.WriteLine("Hello World");
            displayDetails();


            Console.ReadLine();
        }
        /// <summary>
        ///  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.
        /// </summary>
        static void displayDetails()
        {
            string nickName = "My Nick Name";
            string studentNumber = "My Student number";
            string favouriteMovie = "My Favourite movie";


            Console.WriteLine(nickName);
            Console.WriteLine(studentNumber);
            Console.WriteLine(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