Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Pseudocode: For each of the following problems provide: inputs outputs error conditions an algorithm using the pseudocode reference used in class a set of

Write Pseudocode:

For each of the following problems provide:

  1. inputs
  2. outputs
  3. error conditions
  4. an algorithm using the pseudocode reference used in class
  5. a set of test cases
  6. the minimum number of operations executed in your algorithm
  7. the maximum number of operations executed in your algorithm

ISBN. The International Standard Book Number (ISBN) is a 10-digit code that uniquely specifies a book. The rightmost digit is a checksum digit that can be uniquely determined from the other 9 digits in the following manner:

  • Multiply the first digit by 10, the second by 9, the third by 8, and so on, down to the ninth digit by 2.
  • Add the values together.
  • Divide the sum by 11. What is the remainder?
  • If the remainder is 0, the checksum is 0; otherwise, subtract the remainder from 11 to get the checksum digit.
  • If the checksum that you come up with is 10, then X is used as the checksum digit!
  • As an example, the checksum digit corresponding to 020131452 is 5 since 5 is the only value of x between 0 and 10 for which10*0 + 9*2 + 8*0 + 7*1 + 6*3 + 5*1 + 4*4 + 3*5 + 2*2 + 1*x is a multiple of 11.
  • Write an algorithm that reads an integer number of 9 digits and displays the ISBN the checksum digit.
  • Hint 1: to extract the rightmost digit of a number use: COMPUTE digit AS number MODULUS 10
  • Hint 2: to remove the rightmost digit of a number use: COMPUTE number AS number / 10
  • Hint 3: for full credit use a loop to compute the sum
  • Assume the input value is composed of 9 positive integer digits between 0-9. Also assume that the input is a valid ISBN number without the checksum digit.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

How many of the directors are CEOs of other companies?

Answered: 1 week ago

Question

=+5.3. Show that m = E[ X ] minimizes E[(X- m)2].

Answered: 1 week ago

Question

Describe effectiveness of reading at night?

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago