- 1 Write A Python Program To Validate The Dea Numbers According To The Following Algorithm The Program Must First Promp 1 (60.98 KiB) Viewed 17 times
1. Write a Python program to validate the DEA numbers according to the following algorithm. The program MUST first promp
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. Write a Python program to validate the DEA numbers according to the following algorithm. The program MUST first promp
1. Write a Python program to validate the DEA numbers according to the following algorithm. The program MUST first prompt users to enter a number then output whether it is a valid DEA number or not. Table 1. The DEA Number Checksum Algorithm Step Algorithm Example 1 The first two characters must be uppercase letters. BB1388568 2 Sum the first, third, and fifth digits. 1 + 8 + 5 = 14 3 Sum the second, fourth, and sixth digits. 3 + 8 + 6= 17 4 Double the number obtained in step 3. 2 x 17 = 34 5 Sum the numbers from steps 2 and 4. 14 + 34 = 48 6 If the last digit of the DEA number is the same as the last digit of the number obtained in step 5, the DEA number is considered valid. The last digit of BB1388568 and 48 is the same, "8". This checksum indicates that the DEA number is valid.