Skip to content

Commit 1836114

Browse files
committed
Update README.md
1 parent bcdea42 commit 1836114

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ previous numbers, i.e., `T(n)=T(n-1)+T(n-2)+T(n-3), T(1)=T(2)=1, and T(3)=2`). [
208208
209209
18. An ISBN (International Standard Book Number) consists of 10 digits d1d2d3d4d5d6d7d8d9d10. The last digit d10 is a checksum, which is calculated from the other nine digits using the following formula: `(d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 + d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9)% 11`.
210210
* If the checksum is 10, the last digit is denoted X according to the ISBN convention. For the input 013601267, the program should display 0136012671.
211-
* Define a package ‘Package1’ with the class ‘NumberManipulation’ which contains an integer array (size 9) as its instance variable and two methods `extractDigits( )` and `findLastDigit( )`. The `extractDigits( )` method must take an integer number as argument and extract the individual digits of the number and store them in the 9-element integer array. The method `findLastDigit( )` should find out the 10th digit using the above formula and return it.
212-
* Define a main class outside of the package created above and read the 9-digit number as a String. Throw a user defined exception "InvalidInputException" if the length of the input String is not exactly 9 digits and prompt the user to enter the input again. If valid, convert the input into integer and pass it to the method `extractDigits( )` and also invoke `findLastDigit( )` method which would return the last digit. If the last digit is 10, append ‘X’ to the original string else append the digit itself’ and display the ISBN number.
211+
* Define a package ‘Package1’ with the class ‘NumberManipulation’ which contains an integer array (size 9) as its instance variable and two methods `extractDigits( )` and `findLastDigit( )`. The `extractDigits( )` method must take an integer number as argument and extract the individual digits of the number and store them in the 9-element integer array. The method `findLastDigit( )` should find out the 10th digit using the above formula and return it. [NumberManipulation.java](https://github.com/jacobjohn2016/Java-Programming/blob/master/FAT-Practice/src/Package1/NumberManipulation.java)
212+
* Define a main class outside of the package created above and read the 9-digit number as a String. Throw a user defined exception "InvalidInputException" if the length of the input String is not exactly 9 digits and prompt the user to enter the input again. If valid, convert the input into integer and pass it to the method `extractDigits( )` and also invoke `findLastDigit( )` method which would return the last digit. If the last digit is 10, append ‘X’ to the original string else append the digit itself’ and display the ISBN number. [ISBN.java](https://github.com/jacobjohn2016/Java-Programming/blob/master/FAT-Practice/src/ISBN.java)
213213
214214
## Contributions
215215
* Initial Author - [jacobjohn2016](github.com/jacobjohn2016)

0 commit comments

Comments
 (0)