Computer Science, asked by akp1920, 1 year ago

what is the java code of isbn checker

Answers

Answered by MishaDagar
4
Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.

Developer: Sun Microsystems (now owned by Oracle Corporation)

Typing discipline: Static, strong, safe,nominative, manifest

Answered by Anonymous
3

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");

       }

   }

}

Similar questions