Warning! It seems that you are using Dodona within another webpage, so not everything may work properly. Let your teacher know so that he can solve the problem by adjusting a setting in the learning environment. In the meantime, you can click this link to open Dodona in a new window.
Warning! The page was not fully loaded, probably because of a network issue. It could be that not all functionalities work as expected. Please try reloading the page.
H9c OOP - Advanced 1 - Klasse Kluis
Sign in to test your solution.
using System;
namespace H9c
{
// Schrijf hier je Kluis klasse
// Let op: de code is een PRIVAAT veld (private int code)
public class Program
{
public static void Main(string[] args)
{
// JE MAG DE CODE IN DE MAIN METHODE NIET AANPASSEN
Kluis k = new Kluis(9876, "Bankbiljetten en sieraden");
k.ToonInhoud();
bool r1 = k.Openen(1234);
Console.WriteLine($"Poging 1234: {(r1 ? "geslaagd!" : "mislukt.")}");
bool r2 = k.Openen(9876);
Console.WriteLine($"Poging 9876: {(r2 ? "geslaagd!" : "mislukt.")}");
k.ToonInhoud();
k.Sluiten();
k.ToonInhoud();
bool r3 = k.Openen(9876);
k.ToonInhoud();
k.WijzigCode(9876, 1111);
k.WijzigCode(9876, 2222);
k.Sluiten();
bool r4 = k.Openen(9876);
Console.WriteLine($"Poging 9876: {(r4 ? "geslaagd!" : "mislukt.")}");
bool r5 = k.Openen(1111);
Console.WriteLine($"Poging 1111: {(r5 ? "geslaagd!" : "mislukt.")}");
}
}
}