Computer Science Canada Help!Turing String Assignment!! HELP PLEASE!!! |
Author: | turingiscool [ Thu Mar 25, 2010 6:31 pm ] |
Post subject: | Help!Turing String Assignment!! HELP PLEASE!!! |
What is the problem you are having? this is the assignment, please help me!! or tell me what to do!! Write a program that reads names in standard form and prints them in the form <last name>, <any given names> As examples, input of Santa Claus Michael J. Fox Madonna William Henry Richard Charles Windsor should produce output of Claus, Santa Fox, Michael J. Madonna Windsor, William Henry Richard Charles Please specify what version of Turing you are using turing 4.11! |
Author: | USEC_OFFICER [ Thu Mar 25, 2010 8:24 pm ] |
Post subject: | RE:Help!Turing String Assignment!! HELP PLEASE!!! |
Sadly, we at compsci do no give out answers to assignments. If you were to actually tell us where your program is going wrong, we could help you. (Hint: You need two strings for each input. Turing counts spaces as breaks.[Breaking the string into two different parts]) |
Author: | Zren [ Thu Mar 25, 2010 8:49 pm ] | ||
Post subject: | Re: Help!Turing String Assignment!! HELP PLEASE!!! | ||
No you don't. The following will get the spaces and everything after.
There should be a string manipulation walkthrough in the Turing Walkthrough, but here's how you'd approach this particular problem. EDIT: FML, Cervantes has a complete example with code in the Walkthrough. Go there. http://compsci.ca/v3/viewtopic.php?t=8229 |
Author: | USEC_OFFICER [ Fri Mar 26, 2010 11:44 am ] |
Post subject: | RE:Help!Turing String Assignment!! HELP PLEASE!!! |
Shows you what I know. |
Author: | turingiscool [ Fri Mar 26, 2010 3:37 pm ] |
Post subject: | RE:Help!Turing String Assignment!! HELP PLEASE!!! |
my problem is that i get how to find the spaces and string mainpulation and stuff, but i dont really get how to do it because you have to prompt the user for the answer so you cant declare what the string will be and its giving me an error because its saying i havent declared it! can anyone tell me what kind of loop to use? like a for loop or a reular loop? thankyou!! |
Author: | USEC_OFFICER [ Fri Mar 26, 2010 3:43 pm ] |
Post subject: | RE:Help!Turing String Assignment!! HELP PLEASE!!! |
If it is telling you that you haven't declared it, the problem is you haven't put the get statement before that part of the code. You need to get the string first before you can do anything about it. |
Author: | turingiscool [ Fri Mar 26, 2010 3:48 pm ] |
Post subject: | RE:Help!Turing String Assignment!! HELP PLEASE!!! |
OMG THANKS! yayy i fixed it! |