4
Answers

I am working on a project where we have to provide pseudocode as part of the problem solving strategy

Ask a question
Avuya Mxoli

Avuya Mxoli

13y
3.5k
1
I am a 2nd year student and I am working on a Technical Programming project where we are asked to solve a problem about ISBNs. I am now at a step where I have to verify with someone else that my pseudocode works, hence I joined the forum. Basically here I am validating that an ISBN is correct. This is how I made my pseudocode using knowledge from other sites as well. To give some background knowledge, an ISBN  is divided into 4 parts seperated by a hyphen: group code, publisher's code, number of the book title and the check digit. example of a 10 digit ISBN: 0-14-012499-3. You can use this or any ISBN of a text book you have to validate my pseudocode

Display 'Enter a 10 character ISBN'
GET ISBN
total = 0;
FOR counter GOES FROM 1 TO 9//represents the 9 characters excluding the check digit
thisDigit = character 'counter' of 'ISBN';//each character of the ISBN
total = total + thisDigit;//checks the 9 characters of ISBN
END FOR
checkDigit = 10th character of ISBN;
remainder = 11-(total / 11);// this is the formular to calculate the check digit
calculatedCheckDigit = 11 - remainder;
IF(calculatedCheckDigit = 10)
   calculatedCheckDigit = 'X';
END IF
IF(calculatedCheckDigit = checkDigit)
  Display('ISBN is valid')


Thank you


Answers (4)