Question 4 Part i The checksum letter of a 7-digits number is calculated as such: d - [Ci iz is is is io in) • (2 7 6 5 4 3 2 )] mod 11 -( 2i + 7iz + 6is + Sia + 4is + 3i6 + 2i ) mod 11 Where i, is the 1 to last of the 7 digits of the 7-digits number and (2,7.6,5,4,3,2) are the weights. The checksum is a letter which corresponds to the number d as shown in the look-up table below 10 9 7 6 4 3 2 Checksum letter A B D E G J Question da Define a function that meets the following specifications. Method name get id checksum 1. str Parameter This str contains the numerical series mentioned in the description above. The length of the str object is 7. Return value 1. str An uppercase letter Detailed description From the given string of 7 umbers, computer the number d as described in the section 'Part 1'. Return the letter which corresponds to the number d as shown in the look-up table below 10 Checksum letter A B D G Part 2 A typical vehicle registration number comes in the format xXx H y: X- prefixes wwwN - Numerical series (from 1 to 9999, without leading zeroes) y - Checksum The checksum letter is caleulated by first converting the letters into numbers, i.e., where A-1 and Z-26, and numbers to individual digits, potentially giving six individual numbers from the registration plate. However, only two letters of the prefix are used in the checksum. For a three-letter prefix, only the last two letters are used; for a two-letter prefix, both letters are used; for a single letter prefix, the single letter corresponds to the second position, with the first position as 0. For numerals less than four digits, additional zeroes are added in front as placeholders, for example "1" is "0001". SBSS 3229 would therefore give 2, 19, 3, 2, 2 and 9 (note that "S" is discarded); E 12 would give 0, 5, 0, 0, 1 and 2. SS 108 would be given as 19, 19, 0, 1, 0, 8. Each individual number is then multiplied by 6 fixed numbers (9, 4, 5, 4, 3, 2). These are added up, then divided by 19. The remainder corresponds to one of the 19 letters used (A, Z, Y, X, U, T, S, R, P, M, L, K, J, H, G, E, D, C, B), with "Á" corresponding to a remainder of corresponding to 1, "Y" corresponding to 2 and so on. In the case of SBS 3229, the final letter should be a P; for E 23, the final letter should be a H. SS 11 back letter should be a T. The letters F, I, N, O, Q, V and W are not used as checksum letters. Co. "Z"
Question 4 Part i The checksum letter of a 7-digits number is calculated as such: d - [Ci iz is is is io in) • (2 7 6 5 4 3 2 )] mod 11 -( 2i + 7iz + 6is + Sia + 4is + 3i6 + 2i ) mod 11 Where i, is the 1 to last of the 7 digits of the 7-digits number and (2,7.6,5,4,3,2) are the weights. The checksum is a letter which corresponds to the number d as shown in the look-up table below 10 9 7 6 4 3 2 Checksum letter A B D E G J Question da Define a function that meets the following specifications. Method name get id checksum 1. str Parameter This str contains the numerical series mentioned in the description above. The length of the str object is 7. Return value 1. str An uppercase letter Detailed description From the given string of 7 umbers, computer the number d as described in the section 'Part 1'. Return the letter which corresponds to the number d as shown in the look-up table below 10 Checksum letter A B D G Part 2 A typical vehicle registration number comes in the format xXx H y: X- prefixes wwwN - Numerical series (from 1 to 9999, without leading zeroes) y - Checksum The checksum letter is caleulated by first converting the letters into numbers, i.e., where A-1 and Z-26, and numbers to individual digits, potentially giving six individual numbers from the registration plate. However, only two letters of the prefix are used in the checksum. For a three-letter prefix, only the last two letters are used; for a two-letter prefix, both letters are used; for a single letter prefix, the single letter corresponds to the second position, with the first position as 0. For numerals less than four digits, additional zeroes are added in front as placeholders, for example "1" is "0001". SBSS 3229 would therefore give 2, 19, 3, 2, 2 and 9 (note that "S" is discarded); E 12 would give 0, 5, 0, 0, 1 and 2. SS 108 would be given as 19, 19, 0, 1, 0, 8. Each individual number is then multiplied by 6 fixed numbers (9, 4, 5, 4, 3, 2). These are added up, then divided by 19. The remainder corresponds to one of the 19 letters used (A, Z, Y, X, U, T, S, R, P, M, L, K, J, H, G, E, D, C, B), with "Á" corresponding to a remainder of corresponding to 1, "Y" corresponding to 2 and so on. In the case of SBS 3229, the final letter should be a P; for E 23, the final letter should be a H. SS 11 back letter should be a T. The letters F, I, N, O, Q, V and W are not used as checksum letters. Co. "Z"
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education