Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write code in C. #include Thanks in advance! Problem 1 (30 points): IMEI (International Mobile Equipment Identifier) IMEI is a unique number of 15
Please write code in C. #include
Thanks in advance!
Problem 1 (30 points): IMEI (International Mobile Equipment Identifier) IMEI is a unique number of 15 digits given to every mobile phone resource: https://en.wikipedia.org/wiki/International_Mobile_Equipment Identity A method to check if the device is really made by the official manufacturer is to compare the IMEI's last digit, called Luhn digit, with a check digit. If the Luhn digit is equal to the check digit, the device is most probably authentic. Otherwise, it is not authentic for sure. The check digit is calculated as follows: 1) First, we calculate the SUM of the first IMEI's 14 digits by adding a) the digits in the odd positions b) the double of the digits in the even positions. If the double of the digit is a two-digit number, we add each digit separately. For example, suppose that the value of the digit is 8, its double is 16. We therefore add to the SUM the result of l+6 = 7 (and not 16) 2) If the last digit of the calculated SUM is 0, that is the check digit. If not, we subtract the last digit of the calculated SUM from 10 and that is the check digit. For example: let's check the IMEI 357683036257378. Note: the last digit of the given IMEI above is 8 which is the Luhn digit. Apply the above algorithm (by hand) to the first 14 digits, we get 34 (2x5) +7 + (2x6) + 8 + (2x3) + 0 + (2x3) + 6 + (2x2) + 5+ (2x7) + 3t(2x7) 3+(10) +7(12) +8+(6) +0+(6) +6+(4) +5+ (14) +3+ (14) = 62 Then the check digit = 10-2-8. Since the check digit (-8) is equal to the Luhn digit (-8), this IMEI is validStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started