1a.) A checksum is a digit added to the end of a sequence of data…
Question Answered step-by-step 1a.) A checksum is a digit added to the end of a sequence of data… 1a.)A checksum is a digit added to the end of a sequence of data to detect some types of errors in the transmission of data. Given a sequence of decimal digits, the simplest way to compute a checksum is to add all of the digits and then find the remainder modulo (%) 10. For example, the checksum for the sequence 48673 is 8 because (4 + 8 + 6 + 7 + 3) = 28 and 28 % (modulo) 10 = 8. When this sequence of digits is transmitted, the checksum digit will be appended to the end of the sequence and checked on the receiving end. Write a function called validate_checksum(numbers) that takes a list called numbers as a parameter (the numbers list includes the checksum as the last digit in the list). The function computes and checks the checksum digit (using the algorithm described above) and returns True if the last integer in numbers list is the correct checksum value and False otherwise. You MUST use a loop in your solution. You must NOT use slice expressions in your solution (i.e. list[start:stop:step]). You must NOT use string methods or list methods in your solution. For example: If function validate_checksum() were called as follows: validate_checksum([4,8,6,7,3,8])the function should return True . The number 8 is the correct check sum value.i.e. (4 + 8 + 6 + 7 + 3) = 28 and 28 % (modulo) 10 = 8. Note that the checksum digit (last digit) is not included in the calculation. If function validate_checksum() were called as follows: validate_checksum([4,8,6,7,3,2])the function should return False. The number 2 is not the correct check sum value. i.e. (4 + 8 + 6 + 7 + 3) = 28 and 28 % (modulo) 10 = 8 . Note that the checksum digit (last digit) is not included in the calculation. 1b.)Given the following list: numbers = [4,8,6,7,3,2] Show how you would call function validate_checksum(). If the checksum is correct, display ‘Okay’ to the screen. If the checksum is incorrect, display ‘ Error in transmission’ to the screen.If you didn’t complete part a), you may assume that you did in order to answer this question. Computer Science Engineering & Technology Python Programming COMP 1039 Share QuestionEmailCopy link Comments (0)


