Created
December 9, 2014 10:09
-
-
Save tamboer/07f4473f8d23c2c06352 to your computer and use it in GitHub Desktop.
Java CheckBTW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Formatter; | |
| import java.util.Scanner; | |
| public class CheckBTW{ | |
| public static void main(String args[]){ | |
| System.out.print("Geef een getal: "); | |
| Scanner sc = new Scanner(System.in); | |
| int btwNummer = sc.nextInt(); | |
| //int btwNummer = 213252520; | |
| int eersteSewe = btwNummer / 100; | |
| float delen = 97F; | |
| byte rest = (byte)(eersteSewe % delen); | |
| byte controle = (byte)(btwNummer % 100); | |
| System.out.println(controle == 97-rest); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment