Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Asignment
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
HeyoGeo




PostPosted: Tue Dec 05, 2017 8:18 pm   Post subject: Turing Asignment

Hey Guys! So I'm Not Quite Sure If I'm Allowed To Ask Help On This Website. But this is my last resort

I got assigned this question today (December 5th) And it's due (December 6th)

In the nine-digit SIN number given to each person having a job or filing an income tax return in Canada, the ninth digit is a check digit that is used to test the validity of the other digits in the SIN. The ninth digit is determined by the following procedure :

*Double the 2nd, 4th, 6th, and 8th digits;
*Add the digits of the numbers found in step a);
*Add the 1st, 3rd, 5th, and 7th digits;
*Add the numbers found in step b) and c);
*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 SIN numbers and determines whether or not each number is a valid SIN. The program should stop when it reads the value 999999999.

Honestly, I've tried very hard to do this question but I just can't figure out why it's not working! If someone can explain to me what I have to do OR provide me the program for this question it'll be greatly appreciated. Thank You !!
Wink
Sponsor
Sponsor
Sponsor
sponsor
HeyoGeo




PostPosted: Tue Dec 05, 2017 8:38 pm   Post subject: RE:Turing Asignment

Also I forgot to mention. I am limited to only if Statments and loop statments, so I can't use for and all that Sad
TokenHerbz




PostPosted: Tue Dec 05, 2017 10:04 pm   Post subject: RE:Turing Asignment

look up the manual for "intstr" and "strint", this is what your looking for.

http://compsci.ca/holtsoft/doc/

HeyoGeo @ Tue Dec 05, 2017 9:30 pm wrote:
OR provide me the program for this question"

You'll get banned if you ask people to do your work


HeyoGeo @ Tue Dec 05, 2017 9:38 pm wrote:
Also I forgot to mention. I am limited to only if Statments and loop statments, so I can't use for and all that Sad

loops and for statements are the same, loops, just with different styles
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: