Question: 7. For this question you must write a java class called ISBN and a client class called ISBNClient. The partial ISBN class is given

7. For this question you must write a java class called ISBN and a client class called ISBNClient. The partial ISBN class is

7. For this question you must write a java class called ISBN and a client class called ISBNClient. The partial ISBN class is given below. (For this assignment, you will have to submit 2 java files: one for the ISBN class that represents ISBN-10 numbers for books and the other one for the ISBNClient class. //a ISBN class that stores the 2 fields for ISBN calculation public class ISBN { private String digits; private String checkSymbol; //constructs a new ISBN with the given fields public ISBN (String digits, String CheckSymbol) // getter/accessors that returns the fields 'values public String getDigits() public String getCheckSymbol() //returns true if the ISBN is valid else returns false. You will //need to extract each digit to calculate checksum. You can use //charAt or substring methods then convert them to integer and //The algorithm to generate the checksum is given below. public boolean isValid () // returns the string representation of the ISBN // ISBN should be printed in correct format eg: 0-13-394302-X. public String toString() } - Write the client class ISBNClient that asks the user to enter the values for digits and checkSymbol and creates an object of class ISBN and uses the data entered to initialize its fields. Print out ISBN object. Then print out if the given ISBN number valid not. Note: ISBN, the International Standard Book Number, is a special code printed on most books, such as: 0-13-394302-X 1-323-79826-9 The first 9 digits are assigned by a book publisher, and the last symbol is computed from these previous digits by a "weighted sum" as follows. First sum the first digit, and 2 times the second digit, plus 3 times the third digit, plus etc, to 9 times the ninth digit. Then divide this sum by 11 and if it is less than 10 then the remainder becomes the checkSum; otherwise the checkSum is the symbol "X". For example: in the above case 013394302 sum = 0 +2*1+ 3*3 +4*3 + 5*9 + 6*4+7*3+8*0+9*2 = 0+2+9++12+45+24+21+0+18 = 131 check = 131 % 11 10 so, the check symbol is 'X". Similarly, in the second example: 1-323-79826 the check sum is 9. If the computed check is not equal to the check symbol, then there has been an error in the digits. This provides a form of error detection. [20 points]

Step by Step Solution

3.31 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the ISBN class and the ISBNClient class well need to write code that handles the computation and verification of the ISBN10 checksum Belo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!