Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nl.hva.Bestof7;
- import java.util.Scanner;
- /**
- * Naam: Kyle Duttenhofer
- * klas: IS103
- * studentnummer: 500834237
- */
- public class Main {
- public static void main(String[] args) {
- final int AANTAL_WEDSTRIJDEN = 7;
- final int MAX_GEWONNEN = 4;
- int punten1[] = new int[AANTAL_WEDSTRIJDEN];
- int punten2[] = new int[AANTAL_WEDSTRIJDEN];
- int win1 = 0;
- int win2 = 0;
- Scanner scanner = new Scanner(System.in);
- System.out.println("Naam van team 1: ");
- String team1 = scanner.nextLine();
- System.out.println("Naam van team 2: ");
- String team2 = scanner.nextLine();
- while (win1 < MAX_GEWONNEN || win2 < MAX_GEWONNEN) {
- for (int i = 0; i < AANTAL_WEDSTRIJDEN; i++) {
- System.out.print("Aantal punten " + team1 + ": ");
- punten1[i] = scanner.nextInt();
- System.out.print("Aantal punten " + team2 + ": ");
- punten2[i] = scanner.nextInt();
- if (punten1[i] > punten2[i]) {
- win1++;
- System.out.println(team1 + " heeft gewonnen");
- } else {
- win2++;
- System.out.println(team2 + " heeft gewonnen");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement