I have been tasked to write a control program for social security numbers, the number of enthusiasts personnummert is a check digit which is calculated as a model:
6 9 1 2 0 8 1 6 3
2 1 2 1 2 1 2 1 2 / / multiply alternately with 2 / 1
=
12 9 2 2 0 8 2 6 6 / / reply after multi-
1 +2 +9 +2 +2 +0 +8 +2 +6 +6 = 38 / / sum (approximately 10 split)
40-38 = 2 / / hörgre next 10 or so minus the response
gained give us the check digit
program to ask for a person’s birth, then the program will calculate the check digit and
compare with the input. print if it were korekt the entered number, otherwise the alert box …
Please enter SMO person is a woman / man (second last digit is odd with guys and even for girls) and how old he is.
repeated execution, often with features.
(Simple coding)
please help me!
my grade depends on it.
thanks in advance!
/ Johan