Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package plof;
- import java.util.Scanner;
- /**
- * Dit programma implementeert het "Plof" spel
- * @author Martijn van der Meer
- */
- public class Plof {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner Input = new Scanner(System.in);
- //Input voor het plof getal en controle voor juiste waarde
- int PLOFGETAL;
- do {
- System.out.print("Wat is het Plof getal (Moet tussen de 2 en 9 liggen)? ");
- PLOFGETAL = Input.nextInt();
- } while (PLOFGETAL < 2 ^ PLOFGETAL > 9);
- //Input voor het maximale getal
- System.out.print("Tot en met welk getal moet ik tellen? ");
- int MAX = Input.nextInt();
- //Getallen en plof tonen onder juiste voorwaarden
- int GETAL;
- for (GETAL = 1; GETAL <= MAX; GETAL ++) {
- if (GETAL %PLOFGETAL == 0) {
- System.out.print("plof ");
- }
- else {
- System.out.print(GETAL + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement