CSC 230: The Week beginning Sept. 19
No homework. We scheduled the first test for Tuesday September 27. Study for that.
The tests are open book and open notes, which means that you can bring a copy of any program that you or I have written in printed or electronic form.
The tests will be of a format like the lab in that a problem will be described and perhaps some screen captures displayed. Then you are to make an interface that has the described behavior.
Since students will know what the solution should look like and do and since further they have access to previously written code that demonstrates the necessary structures, they are inclined to view any difficulties they encounter with not having enough time. Alas this is the nature of the exam and when the allotted time is up, you will sumit the project as is to be graded.
ISBN numbers
Together we will design and code an interface that determines
ISBN check digits.
prjISBN.exe
Reference:
http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node48.html
An ISBN number is a ten digit number used to identify books. They usually have dashes which we will ignoring. The last digit is the so-called check digit. It is derived from the others in a method described below. It can be used to make sure no mistakes were made in writing down the number. If one of the digits is transcribed incorrectly or if two adjacent digits are accidently exchanged, then a quick calculation can confirm that an error has occured. Similar checking schemes, such as parity checking, checksums and Cyclic Redundancy Check (CRC) are used in computers to valid information.
Consider the following ISBN number.
Positions | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
ISBN digits | 0 | 4 | 7 | 1 | 3 | 4 | 6 | 0 | 9 | 8 |
The last digit, the check digit, is derived in the following way. Multiply all of the other ISBN digits by their position number (note that position numbers start on the right and go to the left with the check bit being in the first position). Then sum those products:
(2)(9) + (3)(0) + (4)(6) + (5)(4) + (6)(3) + (7)(1) + (8)(7) + (9)(4) + (10)(0)
18 + 0 + 24 + 20 + 18 + 7 + 56 + 36 + 0
179
Once you have that sum you divide by 11 and take the remainder.
179 Mod 11 = 3
Subtract your number from 11.
11 -3 = 8
If the number is 11, the check digit is 0. If the number is 10, the check digit is X. Otherwise the number above is the checkd digit.
ISBNZipped.zip (uncommented)