Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * KK KK JJJJJJJJJJ BBBBBBBB
- * KK KK JJ BB BB
- * KKKK JJ BBBBBBBB
- * KK KK JJ JJ BB BB
- * KK KK JJJJJJ BBBBBBBBBB
- *
- * Copyright 2018 Jordy Van Kerkvoorde
- */
- package domein;
- import java.util.Scanner;
- /**
- *
- * @author KeeJayBe
- */
- public class BTWNummerApp {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- System.out.print("Geef een btw-nummer van de vorm ABC.PQR.XYZ zonder de puntjes: ");
- int nummer = s.nextInt();
- boolean geldig = isGeldig(nummer);
- if(geldig){
- System.out.printf("%n%d is een geldig btw-nummer.%n", nummer);
- }else{
- System.out.printf("%n%d is een ongeldig btw-nummer.%n", nummer);
- }
- }
- private static boolean isGeldig(int nr){
- int ax= nr/100;
- int yz= nr%100;
- return (ax%97)+yz==97;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement