Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 Checksum The International Standard Book Number (ISBN) is a 10-digit code that uniquely specifies a book. The rightmost digit is a checksum digit that

image text in transcribed
image text in transcribed
2 Checksum 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, from the condition that di +2d2+3d3+...+10010 must be a multiple of 11 (hered, denotes the ith digit from the right). The check sum digit d, can be any value from 0 to 10: the ISBN convention is to use the character X to denote 10. For example, the checksum digit corresponding to 020131452 is 5, because 5 is the only value of m between 0 and 10 for which 10 x 0+9 x 2 +8 x 0+7x1+6 x 3+5 x 1+4 x 4+3 x 5+2 x 2+1 mm is a multiple of 11. Write a program named checksum.py that takes a 9-digit integer as input, computes the checksum, and writes the ISBN number. For example if the input is 020131452, the checksum value is 5 and the displayed ISBN-10 is 0-201-31452-5. Similarly, if the input is 933257743, the checksum will be 9 and the ISBN-10 is 9-332-57743-9. Add the following comments to the beginning of checksum.py. # FileName : checksum.py # Student ID : # Student Name: Run and test your program. Once your are able to run the program successfully, submit checksum.py using the E-learning system. Hint: The input (i.e., 020131452) should be a string. Use a for loop to loop through each one of the digits in the string. In the loop, convert the individual digit to an integer and do the necessary calculations

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions