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, 22.06.2019 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
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
Social Studies, 12.07.2019 08:30
Questions on the website: 13722361