arrays - C# Confused on passing parameters with a string involved -


really confused on homework assignment have , not looking answer guidance. confused on how accept user input , pass through pull 1 of these response array depending on input being 1 through 5. here problem below.

create program called magic8ball (console or gui, choice). program should contain method (written you) declares array of @ least 5 strings magic 8-ball type phrases such "the answer seems certain" (you can make phrases or use traditional ones--google magic 8ball phrases see them. method should accept 1 parameter, index array of phrase strings. method display phrase associated index that's passed method. example, if string @ phrases[4] "the future seems cloudy" , calling program passed value 4 method method display "the future seems cloudy." include error-handling in method valid indexes produce output.

namespace consoleapp7 {     class program     {         static void main(string[] args)         {             int response;              string[] quotes;             quotes = new string[5];              {                 quotes[1] = ("today going day");                 quotes[2] = ("tomorrow going rain");                 quotes[3] = ("next month blissful");                 quotes[4] = ("you lucky here");                 quotes[5] = ("the love of life notices you");             };              writeline("please enter number between 1 , five");              response = convert.toint32(readline());              if (response = quotes[1])             {              }         }     } } 

namespace consoleapp7 {     class program     {         static void main(string[] args)         {             int response;              string[] quotes = new string [5];               {                 quotes[0] = ("today going day");                 quotes[1] = ("tomorrow going rain");                 quotes[2] = ("next month blissful");                 quotes[3] = ("you lucky here");                 quotes[4] = ("the love of life notices you");             }              writeline("please enter number between 1 , five");              response = convert.toint32(readline());               writeline(quotes[response]); 

Comments