subject
Computers and Technology, 07.12.2020 18:00 2891643

1. Python Exercise 4
In the nine-digit Social Insurance Number (SIN) given to each person having a job or filing an income tax return in Canada, the ninth digit is a checked digit that is used to test the validity of the other digits in the SIN. The ninth digit is determined by the following procedure.
a. Double the 2nd, 4th, 6th, and 8th digits, if it will become a 2 digit number, add all the digits to make it a single digit. For example, 6x2 =12, then 1+2=3
b. Add the digits of the number found in step (a)
c. Add the 1st, 3rd, 5th, and 7th digits.
d. Add the number found in steps (b) and (c)
e. Subtract the units digit of the result of step (d) from 10 and note the units digit of the
result. For the SIN to be valid, its ninth digit must have this value.
Write a program that repeatedly reads nine-digit numbers and determines whether or not each number is a valid SIN> The program should stop when it reads the value 999999999.
Hint: Please look at project 1 to find out how to extract digit.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
What computer network component allows data transfers from one computer to another through a telephone line?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
Match the function to its purpose. fast worth 50pts.
Answers: 1
You know the right answer?
1. Python Exercise 4
In the nine-digit Social Insurance Number (SIN) given to each person hav...
Questions
question
Mathematics, 04.02.2020 23:48
Questions on the website: 13722367