Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help!Turing String Assignment!! HELP PLEASE!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
turingiscool




PostPosted: 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!
Sponsor
Sponsor
Sponsor
sponsor
USEC_OFFICER




PostPosted: 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])
Zren




PostPosted: 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.
Turing:
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




PostPosted: Fri Mar 26, 2010 11:44 am   Post subject: RE:Help!Turing String Assignment!! HELP PLEASE!!!

Shows you what I know.
turingiscool




PostPosted: 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!!
USEC_OFFICER




PostPosted: 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.
turingiscool




PostPosted: Fri Mar 26, 2010 3:48 pm   Post subject: RE:Help!Turing String Assignment!! HELP PLEASE!!!

OMG THANKS! yayy i fixed it!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: