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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 06:00, ashleyd198308
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
image
Computers and Technology, 25.06.2019 11:00, kaitlyn4576
When you are looking for information on wikipedia
Answers: 2
image
Computers and Technology, 25.06.2019 15:00, giavanleer14
When microsoft excel is first opened, where will its content come from?
Answers: 1
image
Computers and Technology, 25.06.2019 16:30, alyssamaize
Unit 3 computer programming study guide refer to code. org for puzzles refer to brainpop; under functions, computer programming, variables part one: define. algorithm- a list of steps to finish a task binary- a way to represent information using 1 and 0 bug- part of a program that does not work correctly code- 1 or more commands to be carried out by a computer function debug sequencing loop repeat conditionals variable part two: answer accordingly. a programmer is to a computer as a teacher is to: a good algorithm must be: imagine writing a program that instructs a bird how to take off, fly and land. what function is likely to be looped? which of the following is most similar to a function? what do variables and functions have in common? 8. the main cause of bugs in coding is: 9. list the following in order from the simplest to most complex: function program step 10. if a program has gone through many iterations, what must be true? 11. what is a benefit of drying up code? a. it makes it less likely to break b. it makes the code compatible with different software c. it saves programmers time d. it makes it less vulnerable to hackers 12. a statement in a function can be most closely compared to: a. a step in a recipe b. a line of a poem c. a brushstroke in a painting d. a piece of assembled furniture t/f: are the solutions provided true? t/f: t/f: t/f:
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 in other subjects:

Konu
Computers and Technology, 25.05.2021 18:40
Konu
Mathematics, 25.05.2021 18:40
Konu
Chemistry, 25.05.2021 18:40