Programming in C#

Diplodocus

New member
Joined
Sep 22, 2016
Messages
4
Points
0
Hey all,

How do I get the following output when I type in my address? See attached image.
I need to make a program where the user types in his or her address to achieve/obtain the output shown below on the attached image.

Programming.png

I know I have to use the Console.ReadLine function, but I don't know how to start or how to configure it.
This is what I have:

Console.WriteLine("Gelieve je adres in te geven:");
Console.WriteLine("Straat \t: \t Parkstraat 50");
Console.WriteLine("Postcode: \t 3000");
Console.WriteLine("Plaats \t: \t Leuven");


Console.WriteLine("Je adreskaart gegevens:");
Console.WriteLine("******************************************");
Console.WriteLine("*Straat \t: Parkstraat 50");
Console.WriteLine("*Postcode \t: 3000");
Console.WriteLine("*Plaats \t: Leuven");
Console.WriteLine("******************************************");

But I think I'm wrong; where and how do I use the ReadLine functions?
 

Rob Whisonant

Moderator
Joined
May 24, 2016
Messages
2,489
Points
113
Well you read what someone types into a variable. Like this.

string line = Console.ReadLine();

Now you have whatever they typed in the variable string_line

Now you can echo what they typed like this.

Console.WriteLine(string_line);

You could do a series of Console.Readline 's asking for each part of the address and save each part to a different variable. Then echo each variable using Console.Writeline 's
 

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top