what is the java code of isbn checker
Answers
Developer: Sun Microsystems (now owned by Oracle Corporation)
Typing discipline: Static, strong, safe,nominative, manifest
import java.util.*;
class ISBN_code
{
public void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a 10 digit integer to check whether it is ISBN code or not");
int n=sc.nextInt();
int c=0;
int d=0;
int cpy=n;
while(n>0)
{
d=n%10;
c=c+1;
n=n/10;
}
if(c!=10)
{
System.out.println("Illegal ISBN code entered");
}
int cpy1=cpy;
int s=0;
while(cpy>0)
{
d=cpy%10;
s=s+(d*c);
c--;
cpy=cpy/10;
}
if(s%11==0)
{
System.out.println("A valid ISBN code entered");
}
else
{
System.out.println("Invalid ISBN code entered");
}
}
}