Advertisement
onomato90

quiz wer.2

Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Toci.Training.MichalJ
  8. {
  9.     class quiz
  10.     {
  11.         public static void codingQuiz()
  12.         {
  13.             Console.WriteLine("Witaj w quizie dla kandydatow na programistow.");
  14.             Console.ReadKey();
  15.             Console.WriteLine();
  16.             Console.WriteLine("Oto pytania: ");
  17.  
  18.             string[] questionsBase = new string[]
  19.             {
  20.                 "1. blablabla",
  21.                 "2. bablabl",
  22.                 "3. blablaba",
  23.                 "4. blabla",
  24.                 "5. bablabla",
  25.                 "6. blablbla"
  26.             };
  27.  
  28.             string[][] answersBase = new string[questionsBase.Length][];
  29.  
  30.             answersBase[0] = new string[]
  31.             {
  32.                 "a) dadda",
  33.                 "b) fasfsa ",
  34.                 "c) safsfsaf",
  35.                 "d) safsafsaf"
  36.             };
  37.  
  38.             answersBase[1] = new string[]
  39.             {
  40.                 "a) ",
  41.                 "b) ",
  42.                 "c) ",
  43.                 "d) "
  44.             };
  45.  
  46.             answersBase[2] = new string[]
  47.             {
  48.                 "a) ",
  49.                 "b) ",
  50.                 "c) ",
  51.                 "d) "
  52.             };
  53.  
  54.             answersBase[3] = new string[]
  55.             {
  56.                 "a) ",
  57.                 "b) ",
  58.                 "c) ",
  59.                 "d) "
  60.             };
  61.  
  62.             answersBase[4] = new string[]
  63.             {
  64.                 "a) ",
  65.                 "b) ",
  66.                 "c) ",
  67.                 "d) "
  68.             };
  69.  
  70.             answersBase[5] = new string[]
  71.             {
  72.                 "a) ",
  73.                 "b) ",
  74.                 "c) ",
  75.                 "d) "
  76.             };
  77.  
  78.             char odp;
  79.  
  80.             for (int i = 0; i < questionsBase.Length; i++)
  81.             {
  82.                 Console.WriteLine(questionsBase[i]);
  83.                 Console.WriteLine();
  84.  
  85.                 for (int j = 0; j < answersBase[i].Length; j++)
  86.                 Console.WriteLine(answersBase[i][j]);
  87.  
  88.                 if (i == 0 && i == 4)
  89.                 {
  90.                     Console.WriteLine();
  91.                         Console.WriteLine("Podaj odpowiedz: ");
  92.                         odp = (char) Console.Read();
  93.                         switch (odp)
  94.                         {
  95.                             case 'a':
  96.                             {
  97.                                 Console.WriteLine("Zla odpowiedz");
  98.                                 Console.WriteLine();
  99.                                 Console.ReadKey();
  100.                                 break;
  101.                             }
  102.                             case 'b':
  103.                             {
  104.                                 Console.WriteLine("Zla odpowiedz");
  105.                                 Console.WriteLine();
  106.                                 Console.ReadKey();
  107.                                 break;
  108.                             }
  109.                             case 'c':
  110.                             {
  111.                                 Console.WriteLine("Dobrze!");
  112.                                 Console.WriteLine();
  113.                                 Console.ReadKey();
  114.                                 break;
  115.                             }
  116.                             case 'd':
  117.                             {
  118.                                 Console.WriteLine("Zla odpowiedz");
  119.                                 Console.WriteLine();
  120.                                 Console.ReadKey();
  121.                                 break;
  122.                             }
  123.                             default:
  124.                             {
  125.                                 Console.WriteLine("Podaj odpowiedz a, b, c lub d");
  126.                                 Console.WriteLine();
  127.                                 Console.ReadKey();
  128.                                 break;
  129.                             }
  130.                         }
  131.  
  132.                 }
  133.  
  134.                 if (i == 3 && i == 5)
  135.                 {
  136.                    Console.WriteLine();
  137.                         Console.WriteLine("Podaj odpowiedz: ");
  138.                         odp = (char) Console.Read();
  139.                         switch (odp)
  140.                         {
  141.                             case 'a':
  142.                             {
  143.                                 Console.WriteLine("Dobrze!");
  144.                                 Console.WriteLine();
  145.                                 Console.ReadKey();
  146.                                 break;
  147.                             }
  148.                             case 'b':
  149.                             {
  150.                                 Console.WriteLine("Zla odpowiedz");
  151.                                 Console.WriteLine();
  152.                                 Console.ReadKey();
  153.                                 break;
  154.                             }
  155.                             case 'c':
  156.                             {
  157.                                 Console.WriteLine("Zla odpowiedz");
  158.                                 Console.WriteLine();
  159.                                 Console.ReadKey();
  160.                                 break;
  161.                             }
  162.                             case 'd':
  163.                             {
  164.                                 Console.WriteLine("Zla odpowiedz");
  165.                                 Console.WriteLine();
  166.                                 Console.ReadKey();
  167.                                 break;
  168.                             }
  169.                             default:
  170.                             {
  171.                                 Console.WriteLine("Podaj odpowiedz a, b, c lub d");
  172.                                 Console.WriteLine();
  173.                                 Console.ReadKey();
  174.                                 break;
  175.                             }
  176.                         }
  177.                 }
  178.  
  179.                 if (i == 1)
  180.                 {
  181.                     Console.WriteLine();
  182.                         Console.WriteLine("Podaj odpowiedz: ");
  183.                         odp = (char) Console.Read();
  184.                         switch (odp)
  185.                         {
  186.                             case 'a':
  187.                             {
  188.                                 Console.WriteLine("Zla odpowiedz");
  189.                                 Console.WriteLine();
  190.                                 Console.ReadKey();
  191.                                 break;
  192.                             }
  193.                             case 'b':
  194.                             {
  195.                                 Console.WriteLine("Zla odpowiedz");
  196.                                 Console.WriteLine();
  197.                                 Console.ReadKey();
  198.                                 break;
  199.                             }
  200.                             case 'c':
  201.                             {
  202.                                 Console.WriteLine("Zla odpowiedz");
  203.                                 Console.WriteLine();
  204.                                 Console.ReadKey();
  205.                                 break;
  206.                             }
  207.                             case 'd':
  208.                             {
  209.                                 Console.WriteLine("Dobrze!");
  210.                                 Console.WriteLine();
  211.                                 Console.ReadKey();
  212.                                 break;
  213.                             }
  214.                             default:
  215.                             {
  216.                                 Console.WriteLine("Podaj odpowiedz a, b, c lub d");
  217.                                 Console.WriteLine();
  218.                                 Console.ReadKey();
  219.                                 break;
  220.                             }
  221.                         }
  222.                 }
  223.  
  224.                 if (i == 2)
  225.                 {
  226.                     Console.WriteLine();
  227.                     Console.WriteLine("Podaj odpowiedz: ");
  228.                     odp = (char) Console.Read();
  229.                     switch (odp)
  230.                     {
  231.                             case 'a':
  232.                             {
  233.                                 Console.WriteLine("Zla odpowiedz");
  234.                                 Console.WriteLine();
  235.                                 Console.ReadKey();
  236.                                 break;
  237.                             }
  238.                             case 'b':
  239.                             {
  240.                                 Console.WriteLine("Dobrze!");
  241.                                 Console.WriteLine();
  242.                                 Console.ReadKey();
  243.                                 break;
  244.                             }
  245.                             case 'c':
  246.                             {
  247.                                 Console.WriteLine("Zla odpowiedz");
  248.                                 Console.WriteLine();
  249.                                 Console.ReadKey();
  250.                                 break;
  251.                             }
  252.                             case 'd':
  253.                             {
  254.                                 Console.WriteLine("Zla odpowiedz");
  255.                                 Console.WriteLine();
  256.                                 Console.ReadKey();
  257.                                 break;
  258.                             }
  259.                             default:
  260.                             {
  261.                                 Console.WriteLine("Podaj odpowiedz a, b, c lub d");
  262.                                 Console.WriteLine();
  263.                                 Console.ReadKey();
  264.                                 break;
  265.                             }
  266.                     }
  267.                 }
  268.  
  269.                 Console.ReadKey();
  270.             }
  271.  
  272.             Console.ReadKey();
  273.  
  274.         }
  275.     }
  276. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement