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,485
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
 
Latest threads
Replies
4
Views
652
Replies
0
Views
94
Replies
1
Views
134
Replies
1
Views
131
Recommended threads
Replies
2
Views
6,122
Replies
8
Views
4,047
Replies
2
Views
2,762
Replies
4
Views
6,743

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