
-----------------------------------
turingiscool
Thu Mar 25, 2010 6:31 pm

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 
,  

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!

-----------------------------------
USEC_OFFICER
Thu Mar 25, 2010 8:24 pm

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])

-----------------------------------
Zren
Thu Mar 25, 2010 8:49 pm

Re: Help!Turing String Assignment!! HELP PLEASE!!!
-----------------------------------
No you don't. The following will get the spaces and everything after.
get str : *


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

-----------------------------------
USEC_OFFICER
Fri Mar 26, 2010 11:44 am

RE:Help!Turing String Assignment!! HELP PLEASE!!!
-----------------------------------
Shows you what I know.

-----------------------------------
turingiscool
Fri Mar 26, 2010 3:37 pm

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!!

-----------------------------------
USEC_OFFICER
Fri Mar 26, 2010 3:43 pm

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.

-----------------------------------
turingiscool
Fri Mar 26, 2010 3:48 pm

RE:Help!Turing String Assignment!! HELP PLEASE!!!
-----------------------------------
OMG THANKS! yayy i fixed it!
