We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08213bd commit 2228c84Copy full SHA for 2228c84
ISBNChecker/src/com/main/chkdgt/ISBNCheckDigit.java
@@ -0,0 +1,23 @@
1
+package com.main.chkdgt;
2
+
3
+import java.util.Scanner;
4
5
+public class ISBNCheckDigit {
6
+ public static String[] ISBN;
7
8
+ public static void main(String[] args) {
9
+ System.out.println("Enter ISBN:");
10
+ Scanner sc = new Scanner(System.in);
11
12
+ int SUM = 0;
13
+ ISBN = sc.nextLine().split("");
14
+ for(int i = 0; i<ISBN.length-1; i++){
15
+ SUM = SUM + (Integer.parseInt(ISBN[i]) * (ISBN.length-i));
16
+ }
17
+ if (11-(SUM % 11) == Integer.parseInt(ISBN[ISBN.length-1])){
18
+ System.out.println("THIS IS A TRUE CODE");
19
20
21
+ sc.close();
22
23
+}
0 commit comments