Created
January 8, 2015 21:36
-
-
Save pressure679/7da6e17324c5d7291bfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Navneting | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Title = "Bruger Liste"; | |
string excelListe = ""; | |
while (true) | |
{ | |
int brugerID = 0; | |
for (int i = 0; i < 5; i++) | |
{ | |
brugerID++; | |
Console.WriteLine("Please enter your first name."); | |
string forNavn = Console.ReadLine(); | |
Console.Clear(); | |
Console.WriteLine("Please enter your last name"); | |
string mitEN = Console.ReadLine(); | |
Console.Clear(); | |
Console.WriteLine("Det indtastede navn er {0} {1}", forNavn, mitEN); | |
Console.WriteLine("Ønsker du at ændre i navnet?"); | |
string ynSvar = Console.ReadLine(); | |
if (ynSvar.ToUpper().Equals("Y")) | |
{ | |
Console.Clear(); | |
} | |
else if (ynSvar.ToUpper().Equals("N")) | |
{ | |
string initialer = forNavn.Substring(0, 1) + mitEN.Substring(0, 1); | |
initialer.ToUpper(); | |
string brugerListe = forNavn + ";" + mitEN + ";" + initialer + ";" + initialer + brugerID; | |
excelListe += brugerListe; | |
Console.WriteLine(brugerListe); | |
{ | |
Console.WriteLine("Vil du tilføje flere navne?"); | |
string ynSvar2 = Console.ReadLine(); | |
if (ynSvar2.ToUpper().Equals("Y")) | |
{ | |
Console.Clear(); | |
break; | |
} | |
else if (ynSvar2.ToUpper().Equals("N")) | |
{ | |
i++; | |
i++; | |
i++; | |
i++; | |
i++; | |
i++; | |
i++; | |
break; | |
} | |
else | |
{ | |
Console.WriteLine("Vælg et gyldigt svar"); | |
} | |
} | |
} | |
else | |
{ | |
Console.WriteLine("Vælg et gyldigt svar"); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment