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.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ComputeAverageApp
{
class ComputeAverageProgram
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.Write("Enter your nickname: ");
string nickname = Console.ReadLine();
Console.Write("Enter your favourite movie/series: ");
string favMovie = Console.ReadLine();
displayDetails(nickname, favMovie);
Console.ReadLine();
}
private static void displayDetails(string nickName, string favMovie)
{
Console.WriteLine("Your nickname: {0}", nickName);
Console.WriteLine("Your favourite movie/series: {0}", favMovie);
}
}
}
Comments
Leave a comment