Write a program that prompts the user for the following values: nickname and favourite movie/series. Write a user defined method named displayDetails() that accepts two string values as input, and then displays these values. Add the required instructions to your Main() program to allow it to display the text Hello World and then calls the displayDetails() method to display your information.
internal class Program
{
static void Main()
{
Console.WriteLine("Hello world");
Console.Write("Enter nickname: ");
string nickname = Console.ReadLine();
Console.Write("Enter favourite movie/series: ");
string favouriteMovie = Console.ReadLine();
displayDetails(nickname, favouriteMovie);
Console.ReadKey();
}
static void displayDetails(string nickname, string favouriteMovie)
{
Console.WriteLine($"Your nickname {nickname}, and favorite series/movie: {favouriteMovie}");
}
}
Comments
Leave a comment