Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 d1 + 2d2 + 3d3 + + 10d10 must be a multiple of 11 (here di denotes the ith digit from the right). The check sum digit d1 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 0 + 9 2 + 8 0 + 7 1 + 6 3 + 5 1 + 4 4 + 3 5 + 2 2 + 1 m 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 3is 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 # StudentID : # StudentName : 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.

end LE for trang Lat pendant 1902 Luca Il fer cum in a SU CASERET Santa NO 1 201 Type here to search O Best

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

=+Why were they effective? How could you continue the campaign?

Answered: 1 week ago

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago