Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. namespace glosor
  2. {
  3. class Program
  4. {
  5.  
  6. static void Main(string[] args)
  7. {
  8. Console.WriteLine("Hello, please enter how many questions you would like to have on this reapeting test");
  9. int numberofquestions = Convert.ToInt32(Console.ReadLine());
  10. while(numberofquestions > 0)
  11. {
  12. Console.WriteLine(" what do you want question number " + numberofquestions + " to be?");
  13.  
  14. QuestionAndAnswer question = new QuestionAndAnswer(null,null);
  15. question.answer = Console.ReadLine();
  16. Console.WriteLine(" what do you want question number " + numberofquestions + "'s answer to be?");
  17. question.answer = Console.ReadLine();
  18. numberofquestions--;
  19. QuestionAndAnswer.numberofquestions++;
  20. }
  21.  
  22.  
  23. }
  24.  
  25.  
  26. class QuestionAndAnswer{
  27. public string question;
  28. public string answer;
  29. public static int numberofquestions;
  30. public QuestionAndAnswer(string _question,string _answer)
  31. {
  32. question = _question;
  33. answer = _answer;
  34.  
  35.  
  36. }
  37. }
  38.  
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement