Level 3 - Condition controlled repetitions 0 van 9 activiteiten opgelost
  1. Capital city Nog niet opgelost
  2. Car value Nog niet opgelost
  3. Adder Nog niet opgelost
  4. Compound interest Nog niet opgelost
  5. Valid month Nog niet opgelost
  6. Cashpoint Nog niet opgelost
  7. Square root Nog niet opgelost
  8. PIN Nog niet opgelost
  9. Measurements Nog niet opgelost
Volgende reeks Assessment point - Levels 1-3
Level 3 - Condition controlled repetitions

Capital city

Meld je aan om je oplossing in te dienen en feedback te krijgen.

// Capital city program using System; class Submission { // ------------------------- // Subprograms // ------------------------- static bool check_answer(string country, string city) { if (country == "England" && city == "London") { return true; } if (country == "France" && city == "Paris") { return true; } else { return false; } } static void capital_cities() { bool correct = false; // Ask for first capital city until correct answer given while (!correct) { string city = Console.ReadLine(); correct = check_answer("England", city); } correct = false; while (!correct) { string city = Console.ReadLine(); correct = check_answer("France", city); } } // ------------------------- // Main program // ------------------------- public static void Main(string[] args) { capital_cities(); Console.WriteLine("The quiz is complete."); } }