An Excellent ISBN Number program ISC practical 2013 [Question 1]
ISBN Number program ISC practical 2013…: solved Java program for ISC Class 12 Computer Science with complete BlueJ code, explanation and sample output.
An ISBN (International Standard Book Number) is a ten-digit code that uniquely identifies a book.
The first nine digits represent the Group, Publisher, and Title of the book and the last digit is used to check whether ISBN is correct or not.
Each of the first nine digits of the code can take a value between 0 and 9. Sometimes it is necessary to make the last digit equal to ten; this is done by writing the last digit of the code as X.
To verify an ISBN, calculate 10 times the first digit, plus 9 times the second digit, plus 8 times the third and so on until we add 1 time the last digit. If the final number leaves no remainder when divided by 11, the code is a valid ISBN.
For Example:1. 0201103311 = 10*0 + 9*2 + 8*0 + 7*1 + 6*1 + 5*0 + 4*3 + 3*3 + 2*1 + 1*1 = 55
Since 55 leaves no remainder when divided by 11, hence it is a valid ISBN.
2. 007462542X = 10*0 + 9*0 + 8*7 + 7*4 + 6*6 + 5*2 + 4*5 + 3*4 + 2*2 + 1*10 = 176
Since 176 leaves no remainder when divided by 11, hence it is a valid ISBN.
3. 0112112425 = 10*0 + 9*1 + 8*1 + 7*2 + 6*1 + 5*1 + 4*1 + 3*4 + 2*2 + 1*5 = 71
Since 71 leaves no remainder when divided by 11, hence it is not a valid ISBN.
Design a program to accept a ten digit code from the user. For an invalid input, display an appropriate message. Verify the code for its validity in the format specified below:Test your program with the sample data and some random data:
Example 1 INPUT CODE: 0201530821
OUTPUT : SUM = 99
LEAVES NO REMAINDER – VALID ISBN CODE
Example 2 INPUT CODE: 035680324
OUTPUT : INVALID INPUT
Example 3 INPUT CODE: 0231428031
OUTPUT : SUM = 122
LEAVES REMAINDER – INVALID ISBN CODE
import java.io.*;
public class IsbnNumber
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a no of 10 digits");
int num=Integer.parseInt(br.readLine());
int sum=0,rem;double rev;
for(int i=1;i<=10;i++)
{
while(num!=0)
{
rev=num%10;//0201103311%10=1
sum+=(rev*i);
num=num/10;//0201103311/10=020110331
}
}
rem=sum%11;
if(rem==0)
System.out.println("Valid ISBN code");
else
System.out.println("Not a valid ISBN code");
}
}Output:
Enter a no of 10 digits
0231428031
Not a valid ISBN code
For more Number programs
Unleashed: Important Number Programs for ICSE Part-1
Related Posts
Continue learning with these related articles

ISC Practical 2027: College Enrolment Code Validator and Stream Report – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 question: validate college enrolment codes made of a stream, year and serial number, give the exact reason for each rejection, auto-correct lowercase streams and prepare a stream-wise report.

ISC Practical 2027: Digital Lock Security Code Analyzer – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 number-logic question: for a 5 to 10 digit security code, find the first and last digits, odd and even position sums, product of non-zero digits, digit frequency and classify the code as STRONG, MODERATE or WEAK.

Boolean Algebra for ISC Class 12: Laws, Canonical SOP and POS, and Simplification
ISC Class 12 Computer Science notes on Boolean algebra: all the laws and theorems, duality, De Morgan's laws, minterms and maxterms, converting to canonical SOP and POS, and step-by-step algebraic simplification with solved examples.