Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Toci.Training.MichalJ
- {
- class quiz
- {
- public static void codingQuiz()
- {
- Console.WriteLine("Witaj w quizie dla kandydatow na programistow.");
- Console.ReadKey();
- Console.WriteLine();
- Console.WriteLine("Oto pytania: ");
- string[] questionsBase = new string[]
- {
- "1. blablabla",
- "2. bablabl",
- "3. blablaba",
- "4. blabla",
- "5. bablabla",
- "6. blablbla"
- };
- string[][] answersBase = new string[questionsBase.Length][];
- answersBase[0] = new string[]
- {
- "a) dadda",
- "b) fasfsa ",
- "c) safsfsaf",
- "d) safsafsaf"
- };
- answersBase[1] = new string[]
- {
- "a) ",
- "b) ",
- "c) ",
- "d) "
- };
- answersBase[2] = new string[]
- {
- "a) ",
- "b) ",
- "c) ",
- "d) "
- };
- answersBase[3] = new string[]
- {
- "a) ",
- "b) ",
- "c) ",
- "d) "
- };
- answersBase[4] = new string[]
- {
- "a) ",
- "b) ",
- "c) ",
- "d) "
- };
- answersBase[5] = new string[]
- {
- "a) ",
- "b) ",
- "c) ",
- "d) "
- };
- for (int i = 0; i < questionsBase.Length; i++)
- {
- Console.WriteLine(questionsBase[i]);
- Console.WriteLine();
- for (int j = 0; j < answersBase[i].Length; j++)
- {
- Console.WriteLine(answersBase[i][j]);
- }
- while (i == 0 || i == 4)
- {
- char odp1;
- Console.WriteLine();
- Label1: Console.WriteLine("Podaj odpowiedz: ");
- odp1 = (char)Console.Read();
- switch (odp1)
- {
- case 'a':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label1;
- }
- case 'b':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label1;
- }
- case 'c':
- {
- Console.WriteLine();
- Console.WriteLine("Dobrze!");
- Console.WriteLine();
- break;
- }
- case 'd':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label1;
- }
- default:
- {
- Console.WriteLine();
- Console.WriteLine("Podaj odpowiedz a, b, c lub d");
- Console.WriteLine();
- goto Label1;
- }
- }
- if (odp1 == 'c')
- break;
- }
- while (i == 3 || i == 5)
- {
- char odp2;
- Console.WriteLine();
- Label2: Console.WriteLine("Podaj odpowiedz: ");
- odp2 = (char) Console.Read();
- switch (odp2)
- {
- case 'a':
- {
- Console.WriteLine();
- Console.WriteLine("Dobrze!");
- Console.WriteLine();
- break;
- }
- case 'b':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label2;
- }
- case 'c':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label2;
- }
- case 'd':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label2;
- }
- default:
- {
- Console.WriteLine();
- Console.WriteLine("Podaj odpowiedz a, b, c lub d");
- Console.WriteLine();
- goto Label2;
- }
- }
- if (odp2 == 'a')
- break;
- }
- while (i == 1)
- {
- char odp3;
- Console.WriteLine();
- Label3: Console.WriteLine("Podaj odpowiedz: ");
- odp3 = (char) Console.Read();
- switch (odp3)
- {
- case 'a':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label3;
- }
- case 'b':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.ReadKey();
- goto Label3;
- }
- case 'c':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label3;
- }
- case 'd':
- {
- Console.WriteLine();
- Console.WriteLine("Dobrze!");
- Console.WriteLine();
- break;
- }
- default:
- {
- Console.WriteLine();
- Console.WriteLine("Podaj odpowiedz a, b, c lub d");
- Console.WriteLine();
- goto Label3;
- }
- }
- if (odp3 == 'd')
- break;
- }
- while (i == 2)
- {
- char odp4;
- Console.WriteLine();
- Label4: Console.WriteLine("Podaj odpowiedz: ");
- odp4 = (char) Console.Read();
- switch (odp4)
- {
- case 'a':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label4;
- }
- case 'b':
- {
- Console.WriteLine();
- Console.WriteLine("Dobrze!");
- Console.WriteLine();
- break;
- }
- case 'c':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label4;
- }
- case 'd':
- {
- Console.WriteLine();
- Console.WriteLine("Zla odpowiedz");
- Console.WriteLine();
- goto Label4;
- }
- default:
- {
- Console.WriteLine();
- Console.WriteLine("Podaj odpowiedz a, b, c lub d");
- Console.WriteLine();
- goto Label4;
- }
- }
- if (odp4 == 'b')
- break;
- }
- Console.ReadKey();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement