Homework Solution: I creating a program that ask the user to enter a name, and it outputs a nickname to…

    visual C# I creating a program that ask the user to enter a name, and it outputs a nickname to the user. everything is working well with the program, I just have one problem. When the user types in their name they are receiving a different nickname everytime. The nickname that is displayed should be the same everytime that the same name is inputed. For example: if the user inputs "Bravo" and his output is "Boy Wonder" then "Boy Wonder is what the output should be everytime that Bravo is entered, and the problem I am having now is that if I were to enter "Bravo" the nickname that is outputted is never the same. attahced is a snap shot of my code I have now8 public class Program public static void Main() :2 13 し5 L6 L7 18 string userInput; Console.WriteLine(Please enter your name to receive a nick name...) string[] firstick new string [30] { Wild Thing, Crazy Eyes, Goofy Goober, Shady Subject, Smelly Thing, Lost One, Smarty, Nosey, Clumsy, Grumpy, Happy Feet, Smiley, Insane in the membrane, Sleepy, BOSS, Angry One, Tough One, Phyco One, Loving One, Sneaky, Caring One, Crybaby, Chosen One, The GOAT, Annoying One, Softy, Scary, Funky,KooKoo, Amazing One Random rannew Random); 23 24 25 Console.Write(insert name: //create list of objects //input nickname 27 29 userInput-Console.ReadLine); Console.WriteLine(From this point foward you will go by: (0), firstNick[ran.Next (,29)1
    8 public class Program public static void Main() :2 13 し5 L6 L7 18 string userInput; Console.WriteLine("Please enter your name to receive a nick name...") string[] firstick new string [30] { "Wild Thing", "Crazy Eyes", "Goofy Goober", "Shady Subject", "Smelly Thing", "Lost One", "Smarty", "Nosey", "Clumsy", "Grumpy", "Happy Feet", "Smiley", "Insane in the membrane", "Sleepy", "BOSS", "Angry One", "Tough One", "Phyco One", "Loving One", "Sneaky", "Caring One", "Crybaby", "Chosen One", "The GOAT", "Annoying One", "Softy", "Scary", "Funky","KooKoo", "Amazing One" Random rannew Random); 23 24 25 Console.Write("insert name: " //create list of objects //input nickname 27 29 userInput-Console.ReadLine); Console.WriteLine("From this point foward you will go by: (0), firstNick[ran.Next (,29)1

    Expert Answer

     
    using System; class MainClass {

    visual C#

    I creating a program that pray the portraiturer to invade a spectry, and it outputs a nickspectry to the portraiturer. anything is launched well-mannered-mannered with the program, I lawful accept undivided quantity. When the portraiturer types in their spectry they are receiving a divergent nickspectry totaltime. The nickspectry that is displayed should be the identical totalperiod that the identical spectry is inputed. For example: if the portraiturer inputs “Bravo” and his output is “Boy Wonder” then “Boy Wonder is what the output should be totalperiod that Bravo is invadeed, and the quantity I am having now is that if I were to invade “Bravo” the nickspectry that is outputted is never the identical. attahced is a split shot of my regulation I accept now8 national dispose Program national static null Main() :2 13 し5 L6 L7 18 string portraiturerInput; Console.WriteLine(Please invade your spectry to take a nick spectry...) string[] firstick upstart string [30] { Wild Thing, Crazy Eyes, Goofy Goober, Shady Subject, Smelly Thing, Lost Undivided, Smarty, Nosey, Clumsy, Grumpy, Happy Feet, Smiley, Insane in the membrane, Sleepy, BOSS, Angry Undivided, Tough Undivided, Phyco Undivided, Loving Undivided, Sneaky, Caring Undivided, Crybaby, Chosen Undivided, The GOAT, Annoying Undivided, Softy, Scary, Funky,KooKoo, Amazing Undivided Aimless ranupstart Aimless); 23 24 25 Console.Write(extort spectry: //create schedule of objects //input nickspectry 27 29 portraiturerInput-Console.ReadLine); Console.WriteLine(From this object foward you conquer go by: (0), firstNick[ran.Next (,29)1

    8 national dispose Program national static null Main() :2 13 し5 L6 L7 18 string portraiturerInput; Console.WriteLine(“Please invade your spectry to take a nick spectry…”) string[] firstick upstart string [30] { “Wild Thing”, “Crazy Eyes”, “Goofy Goober”, “Shady Subject”, “Smelly Thing”, “Lost Undivided”, “Smarty”, “Nosey”, “Clumsy”, “Grumpy”, “Happy Feet”, “Smiley”, “Insane in the membrane”, “Sleepy”, “BOSS”, “Angry Undivided”, “Tough Undivided”, “Phyco Undivided”, “Loving Undivided”, “Sneaky”, “Caring Undivided”, “Crybaby”, “Chosen Undivided”, “The GOAT”, “Annoying Undivided”, “Softy”, “Scary”, “Funky”,”KooKoo”, “Amazing Undivided” Aimless ranupstart Aimless); 23 24 25 Console.Write(“extort spectry: ” //create schedule of objects //input nickspectry 27 29 portraiturerInput-Console.ReadLine); Console.WriteLine(“From this object foward you conquer go by: (0), firstNick[ran.Next (,29)1

    Expert Solution

     

    using System;

    dispose MainDispose {

    national static int earnIndex(string s) {

    int a = Math.Abs(s.GetHashCode()) % 30;

    Console.WriteLine(“Protest {0} …n”, a);

    return a;

    }

    national static null Main (string[] args) {

    string portraiturerInput;

    Console.WriteLine(“Please invade your spectry to take a nick spectry…”);

    string[] firstNick = upstart string[30]{“Wild Thing”, “Crazy Eyes”, “Goofy Goober”,

    “Wild Thing1”, “Crazy Eyes1”, “Goofy Goober1”,

    “Wild Thing2”, “Crazy Eyes2”, “Goofy Goober2”,

    “Wild Thing3”, “Crazy Eyes3”, “Goofy Goober3”,

    “Wild Thing4”, “Crazy Eyes4”, “Goofy Goober4”,

    “Wild Thing5”, “Crazy Eyes5”, “Goofy Goober5”,

    “Wild Thing6”, “Crazy Eyes6”, “Goofy Goober6”,

    “Wild Thing7”, “Crazy Eyes7”, “Goofy Goober7”,

    “Wild Thing8”, “Crazy Eyes8”, “Goofy Goober8”,

    “Wild Thing9”, “Crazy Eyes9”, “Goofy Goober9”

    };

    // the aimless module gives you a upstart protest each period, that is why you are referable earnting the identical nickspectry total period..

    // Aimless ran = upstart Aimless();

    // You need to portraiture some protest which is fixed on portraiturer input.. media if portraiturerInput the identical string frequently, you should earn the identical protest

    Console.Write(“Extort spectry: “);

    userInput = Console.ReadLine();

    Console.WriteLine(“From this object obtrusive, you conquer go by: {0}”, firstNick[getIndex(userInput)]);

    }

    }