Respuesta :
Answer:
//import the necessary libraries
using System.IO;
using System;
//Begin class definition
class PersonalInfo
{
//Begin main method
static void Main()
{
//Declare all needed variables
string name;
string birthdate;
string workphonenumber;
string cellphonenumber;
//Prompt user to enter name
Console.WriteLine("Please enter your name");
//Receive the user name and store in the name variable
name = Console.ReadLine();
//Prompt the user to enter date of birth
Console.WriteLine("Please enter your birthday (dd/mm/yyyy)");
//Receive the user date of birth and store in the right variable
birthdate = Console.ReadLine();
//Prompt the user to enter work phone number
Console.WriteLine("Please enter your work phone number");
//Receive and store the user work phone number
workphonenumber = Console.ReadLine();
//Prompt the user to enter cell phone number
Console.WriteLine("Please enter your cell phone number");
//Receive and store the user cell phone number
cellphonenumber = Console.ReadLine();
//Now display the result
Console.WriteLine("========Your Info========");
Console.WriteLine("Name: {0} ", name);
Console.WriteLine("Date of birth: {0} ", birthdate);
Console.WriteLine("Work Phone Number: {0} ", workphonenumber);
Console.WriteLine("Cell Phone Number: {0} ", cellphonenumber);
}
}
Sample Output
Please enter your name
>>Omobowale
Please enter your birthday (dd/mm/yyyy)
>>19/05/1990
Please enter your work phone number
>>08022222222
Please enter your cell phone number
>>08033333333
========Your Info========
Name: Omobowale
Date of birth: 19/05/1990
Work Phone Number: 08022222222
Cell Phone Number: 08033333333
Explanation:
The code above has been written in C#. It contains comments explaining each line of the code. Kindly go through the comments. A sample output has also been provided.
Should you need the program file, please find it attached to this response.