Hi, I had an earlier post but it got f*ckd over by database issues so I am reposting this. I need to find a way to tie in an ID check digit of some sort. Here's my code so far:
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, sum;
cout << "Enter the first 2 digits of your 8-digit ID number now.\n";
cin >> a;
cout << "Now the next 2 digits?\n";
cin >> b;
cout << "And the next 2?\n";
cin >> c;
cout << "Finally the last 2 digits. Thank You!\n";
cin >> d;
sum = a+b+c+d;
sum%26
cout << "Your ID number with appended checkdigits: \n";
return 0;
}
Ok so there is my coed, now I just need to figure out a rule that goes like this example:
ID=34567890
SUM=34+56+78+90
sum%26=24
24->Y
34567890Y <-IDnumber with checkdigit.
I AM NOT LOOKING FOR ANSWERS, just suggestions/help. Thanks!
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, sum;
cout << "Enter the first 2 digits of your 8-digit ID number now.\n";
cin >> a;
cout << "Now the next 2 digits?\n";
cin >> b;
cout << "And the next 2?\n";
cin >> c;
cout << "Finally the last 2 digits. Thank You!\n";
cin >> d;
sum = a+b+c+d;
sum%26
cout << "Your ID number with appended checkdigits: \n";
return 0;
}
Ok so there is my coed, now I just need to figure out a rule that goes like this example:
ID=34567890
SUM=34+56+78+90
sum%26=24
24->Y
34567890Y <-IDnumber with checkdigit.
I AM NOT LOOKING FOR ANSWERS, just suggestions/help. Thanks!