Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random name switch
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Random Rand0 = new Random(); int name0 = Rand0.Next(1,6); Random Rand1 = new Random(); int sirname1 = Rand0.Next(1,6); Random Rand2 = new Random(); int address2 = Rand0.Next(1,6); Random Rand3 = new Random(); int occupation3 = Rand0.Next(1,6); Random Rand4 = new Random(); int name4 = Rand0.Next(1,6); string firstName = ""; string sirName = ""; string address = ""; string occupation = ""; switch (name0) { case 1: firstName = "John"; break; case 2: firstName = "Gary"; break; case 3: firstName = "Finn"; break; case 4: firstName = "Raj"; break; case 5: firstName = "Sean"; break; } switch (sirname1) { case 1: sirName = " Smith"; break; case 2: sirName = " Collins"; break; case 3: sirName = " Halligan"; break; case 4: sirName = " Nazir"; break; case 5: sirName = " Liggins"; break; } switch (sirname1) { case 1: sirName = " Smith"; break; case 2: sirName = " Collins"; break; case 3: sirName = " Halligan"; break; case 4: sirName = " Nazir"; break; case 5: sirName = " Liggins"; break; } switch (address2) { case 1: address = "200 Larkin Street San Francisco, CA 94102, US"; break; case 2: address = "20 Vauxhall Bridge Road, London, United Kingdom"; break; case 3: address = "45 High Corners, Richmond, Alabama, 35252-4249, US"; break; case 4: address = "18 Poland Road, Wairau Valley, Auckland, New Zealand"; break; case 5: address = "24 Sussex Dr, Ottawa, ON, Canada"; break; } switch (occupation3) { case 1: occupation = "Call Centre Agent"; break; case 2: occupation = "Surveyor"; break; case 3: occupation = "Postal Delivery Worker"; break; case 4: occupation = "Unemployed"; break; case 5: occupation = "Book-Keeper"; break; } Console.WriteLine(firstName + "" + sirName); Console.WriteLine(occupation); Console.WriteLine(address); } } }
run
|
edit
|
history
|
help
0
dfdfd
Sum
transform string to hex code
Inheritance Gone Wrong Template
Test Random
Linq Func Action
Fórum ➡ Calculate the Sum of Values in List of KeyValuePair<> objects ♦
Operators
gggsggsgg
squaredigits