This problem is slightly more difficult than the above problem. This one requires a data type that stores 10 digits. Background Publishers and bookstores use a number system called the International Standard Book Number (ISBN) system to identify books. At the start of publication, each book is assigned a unique ISBN. An ISBN, once assigned, can never be re-used. Click here for detailed information on this numbering system. An ISBN consists of exactly 10 digits. The rightmost digit is the check digit. The check digit is validated modulo 11. • multiply each digit from the first to the ninth by a weight from 10 to 2 respectively (the first digit by 10, the second by 9,.., the ninth by 2). • the sum of the products plus the check digit should be divisible without remainder by 11. • if there is a remainder, the whole number is not a valid ISBN Specifications Design a program that validates an ISBN. Your program keeps accepting a whole number and determining if that whole number is a valid ISBN. Your program terminates when the user enters 0 as the whole number. The output from your program looks something like

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 14PE
icon
Related questions
Question

ISBN
This problem is slightly more difficult than the above problem. This one requires a data type that 
stores 10 digits. 
Background
Publishers and bookstores use a number system called the International Standard Book Number (ISBN) 
system to identify books. At the start of publication, each book is assigned a unique ISBN. An ISBN, 
once assigned, can never be re-used. Click here for detailed information on this numbering system.
An ISBN consists of exactly 10 digits. The rightmost digit is the check digit. The check digit is 
validated modulo 11.
• multiply each digit from the first to the ninth by a weight from 10 to 2 respectively (the first 
digit by 10, the second by 9,.., the ninth by 2).
• the sum of the products plus the check digit should be divisible without remainder by 11.
• if there is a remainder, the whole number is not a valid ISBN

Specifications
Design a program that validates an ISBN. Your program keeps accepting a whole number and 
determining if that whole number is a valid ISBN. Your program terminates when the user enters 0 as 
the whole number.
The output from your program looks something like

 

 

 

Consider the following example:
ISas 0003194876
check digit is 6
add first set of alternates to themselves
0 0 0 3 19 487
10 9 87 6543 2
O 0 0 21 6 45 16 24 14 - 126
add check digit
total
132
12
divide by 11
remainder
Therefore this ISBN is valid
Specifications
Design a program that validates an ISBN. Your program keeps accepting a whole number and
determining if that whole number is a valid ISBN. Your program terminates when the user enters 0 as
the whole number.
The output from your program looks something like:
Transcribed Image Text:Consider the following example: ISas 0003194876 check digit is 6 add first set of alternates to themselves 0 0 0 3 19 487 10 9 87 6543 2 O 0 0 21 6 45 16 24 14 - 126 add check digit total 132 12 divide by 11 remainder Therefore this ISBN is valid Specifications Design a program that validates an ISBN. Your program keeps accepting a whole number and determining if that whole number is a valid ISBN. Your program terminates when the user enters 0 as the whole number. The output from your program looks something like:
The output from your program looks something like:
ISBN Validator
ISBN (0 to quit): 0003194876
This is a valid ISBN.
ISBN (0 to quit): 0003194875
This is not a valid ISBN.
ISBN (0 to quit): 0
Have a Nice Day!
Transcribed Image Text:The output from your program looks something like: ISBN Validator ISBN (0 to quit): 0003194876 This is a valid ISBN. ISBN (0 to quit): 0003194875 This is not a valid ISBN. ISBN (0 to quit): 0 Have a Nice Day!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning