Arrays in pseudocode
Im still working on the ISBN project and now Ive validated it, the next step is to convert a 10-digit ISBN to a 13-digit ISBN. I got the formular for that now I want to create procedural pseudocode showing the steps. I was thinking of using an array to store the 10 digit array because inorder to convert it I have to divide the digits somehow coz the formular wants us to add the digits in the even positions then multiply them by 3, add that to the sum of the digits in the odd positions...and so on. So if this was a normal c# problem I'd store the ISBN in a file each digit seperated by a character e.g 0#2#3#0#4#5#6#4#7#9 so that I can use a streamreader to store the odd numbers alone and the even numbers alone in seperate arrays... I'll stop here for now in case thers things that aren't clear. Thanks

VulpesRank #55 · 29.2K reputationPosted Apr 18, 2011, 6:42 AM EDT
However, to write a string to a file you can do:
System.IO.File.WriteAllText(filePath, myString);
or, if you're working from a char array, you need this step first:
string myString = new string(myCharArray);
No delimiters have been added in either case.
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2011, 7:34 AM EDT
Incidentally, there's no real need for the # separators in the file. You could still do it by iterating through the characters in the string and converting them to digits - the code would need adjusting a bit.
Sam HobbsRank #107 · 20.5K reputationPosted Apr 3, 2011, 11:09 AM EDT
Okay, sorry Vulpes; I now see your note that the bottom of your post says what I said.
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 4, 2011, 2:54 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 4, 2011, 5:17 AM EDT
However, here's my attempt:
STORE in 'remainder'
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 17, 2011, 10:57 PM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 18, 2011, 11:54 AM EDT
So do you want help with real code (not pseudocode) for reading ISBNs?
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 18, 2011, 9:54 PM EDT
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 18, 2011, 9:56 PM EDT