Ditutup

Canada Customs Transaction

I programmed this for PHP, but now it seems we need an offline version, which I would prefer in C, as it is extremely simple, yet I cannot program in C. it would be console (dos) based, and requesting an input for only $trail, $security being 12963. the security # is not really a security number like you would think, it's just a reference number for our systems. my php code is as follows:

<?

/*****************************************************

Filename: [url removed, login to view]

Function: Generate check digit number for Canada

Customs transaction numbers

Writer: Ryan Forsyth

Date: 06/27/06

*****************************************************/

Function Transaction($security="", $trail="", $reference="") {

//Turn sections into 13 digit reference Number

$transaction = $security.$trail.$reference;

//Split transaction into seperate digits in an array

$split = preg_split('//', $transaction, -1, PREG_SPLIT_NO_EMPTY);

//Starting value for check digit

$sum = 0;

//Used to ensure calculation is even/odd/even/etc

$multiplier = 0;

//Start checking in array for values

foreach ($split as $value) {

//If multiplier is an even number, do this

if(($multiplier - (2 * floor($multiplier/2))) == 0) {

//multiply by 1 to get the even sum

$numb = ($value * 1);

//Check to make sure number is 10 or under. If over, add the first digit

//to the second digit until end number is single digit

while($numb >= 10) {

$split_numb = preg_split('//', $numb, -1, PREG_SPLIT_NO_EMPTY);

$numb = ($split_numb[0] + $split_numb[1]);

}

//add value to sum

$sum = $numb + $sum;

}

//If multiplier is an odd number, do this

else {

//multiply by 2 to get the odd sum

$numb = ($value * 2);

//Check to make sure number is 10 or under. If over, add the first digit

//to the second digit until end number is single digit

while($numb >= 10) {

$split_numb = preg_split('//', $numb, -1, PREG_SPLIT_NO_EMPTY);

$numb = ($split_numb[0] + $split_numb[1]);

}

//add value to sum

$sum = $numb + $sum;

}

//Add 1 to multiplier to switch between even and odd

$multiplier++;

}

//Divide sum by 10 to get a quotient and a remainder

$sum = $sum/10;

//Split quotient and remainder into an array

$sum = explode(".", $sum);

//Output the remainder as check digit for the reference number

return $sum[1];

}

?>

Kemahiran: Pengaturcaraan C

Lihat lebih lanjut: check digit canada customs, check canada customs number, canada customs transaction numbers, canada customs transaction number, writer in canada, numbers function, lt security, function numbers, code offline, canada customs transaction check digit calculation, canada customs reference number, can check transaction customs, check transaction customs, entry transaction number canada customs, transaction security code canada customs, customs canada bid, customs transaction number, canada transaction numbers, check canada customs, preg_split digits, canada customs, customs, canada numbers, writer security, simple console

Tentang Majikan:
( 0 ulasan ) Winnipeg, Canada

ID Projek: #340809

16 freelancers are bidding on average $90 for this job

OrionConsulting

Hello, I am an experienced, Ontario-based C programmer. I can port your code into C easily. The only additional information I would need from you would be a set of 5 numbers and associated checksums so that the module Lagi

$60 USD dalam 2 hari
(1 Ulasan)
2.7
J711

I to do this now!

$100 USD dalam 0 hari
(1 Ulasan)
2.5
osamafarook

it is very simple task. It takes only 1 hour from me.

$30 USD dalam 0 hari
(0 Ulasan)
0.0
embeddcoder

i am interested

$200 USD dalam 15 hari
(0 Ulasan)
0.0
dqs111

hi I'am a C/C++ coder,I use php and C++ both.

$40 USD dalam 0 hari
(0 Ulasan)
0.0
manasiarora

i'm interested

$50 USD dalam 5 hari
(0 Ulasan)
0.0
Giantsoft

pls see the pm.

$30 USD dalam sehari
(0 Ulasan)
0.0
lunaroverlord

Ready to start.

$30 USD dalam sehari
(0 Ulasan)
0.0
sreevalli1

having good know ledge in c ready to start the work

$80 USD dalam 5 hari
(0 Ulasan)
0.0
NachiketDatar

I will do it with all quality tests required

$200 USD dalam 4 hari
(0 Ulasan)
0.0
MajidAsgari7

Pelase see my PM

$230 USD dalam 3 hari
(0 Ulasan)
0.0
sree466

i can do this

$100 USD dalam sehari
(0 Ulasan)
0.0
cyboth

It can be done without problems, and very quickly in c++.

$80 USD dalam sehari
(0 Ulasan)
0.0
mdelap

can you send me samples of your input data? Appreciate. Could you tell whether multithread can be used? Thanks

$30 USD dalam sehari
(0 Ulasan)
0.0
dmitryt15

Hello, I am experienced c/c++ developer, and I can do this task with high quality. (see my PM)

$30 USD dalam 0 hari
(0 Ulasan)
0.0
WEBOWEB

hi my team is expert in c/c++ so your work will be done professionals the work can be completed in less days if you say your work will be done in a priority way looking forward for the work regards team weboweb

$150 USD dalam 3 hari
(0 Ulasan)
0.0