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

Username:   Password: 
 RegisterRegister   
 Need help!
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Risen123




PostPosted: Thu Nov 08, 2012 12:50 pm   Post subject: Need help!

[I have a test tommorow that is open book. I have been busy with family issues so haven't had time to study and learn all of these in class.

Questions should be fully coded, they are the following!

1.Input a word, once inputted make the word spelt vertically with a space between each letter

2.When a sentance is inputted, delete the spaces between the sentance and output it

3.Open a file and add all the numbers in the file a nd output the sum

4.Input a word and space it out in between letters

5.Take all the a's and turn them into z's in the sentance

6.Go through a text file and count how many numbers there are
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Nov 08, 2012 1:04 pm   Post subject: RE:Need help!

Thx for sharing!
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Risen123




PostPosted: Thu Nov 08, 2012 3:34 pm   Post subject: RE:Need help!

Somebody help please!
evildaddy911




PostPosted: Thu Nov 08, 2012 3:58 pm   Post subject: RE:Need help!

thank you for telling us this. Shall I assume you want help with this?

What the teacher wants you to do is basically string manipulation. string manipulation generally goes as such:
Turing:

for i : 1 .. length (string)
    %
    %
end for


One thing you need to keep in mind is that strings are essentially arrays, each element being one character.
Risen123




PostPosted: Thu Nov 08, 2012 4:16 pm   Post subject: RE:Need help!

It would help if I could get an example of a few of them so I know what I'm looking for, I literally missed 3 weeks of school because my parents were divorcing and I went into clinical depression

Please anyone!
Tony




PostPosted: Thu Nov 08, 2012 4:40 pm   Post subject: RE:Need help!

a good example would be
Turing:

var word : string
put "enter a word"
get word

for i : 0 .. length(word) - 1
   put "letter in position ", i, " is: ", word(i)
end for
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Risen123




PostPosted: Thu Nov 08, 2012 5:02 pm   Post subject: RE:Need help!

#1, #3, #6 if answered would be amazing!
[Gandalf]




PostPosted: Thu Nov 08, 2012 5:29 pm   Post subject: Re: Need help!

We won't answer your test questions for you, or do your homework for you. Although, if you search through these forums I'm sure you'll find code very similar to what you need, and probably learn a thing or two. You can start with the Turing Walkthrough.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Nov 08, 2012 5:32 pm   Post subject: RE:Need help!

My example is really really close to what #1 is asking for. What part is it missing? How do you think that could be solved?

#3,6 are presumably difficult because they deal with files. The Turing Walkthrough is your crash course through everything Turing, which links you to a File Tutorial -- http://compsci.ca/v3/viewtopic.php?t=12972 You will only need "put" and "get" modes of access. Don't worry about "read" or "write".
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Risen123




PostPosted: Thu Nov 08, 2012 6:36 pm   Post subject: RE:Need help!

I have #1 but it makes the text backwards! how do you fix that?


var line : string

% Input a string from the user

locate (1, 1)

put "Enter a phrase. " ..
get line : *

% Display sentence with spaces between them

for decreasing i : length (line) .. 1
put line (i), " " ..
end for
Insectoid




PostPosted: Thu Nov 08, 2012 6:40 pm   Post subject: RE:Need help!

code:
for decreasing i : length (line) .. 1


Hmm, I wonder what the problem could possibly be. Can't seem to find anywhere! I thought it would be painfully obvious, but evidently I was wrong.
Risen123




PostPosted: Thu Nov 08, 2012 6:42 pm   Post subject: RE:Need help!

I don't know how to fix it! I went complete dummy on it Sad

I tried making it increasing, didn't work

how do I fix it? Surprised
Aange10




PostPosted: Thu Nov 08, 2012 7:01 pm   Post subject: RE:Need help!

Listen to what they're telling you. The Turing Walkthrough has your answer.

http://compsci.ca/v3/viewtopic.php?t=3678
Risen123




PostPosted: Thu Nov 08, 2012 7:07 pm   Post subject: RE:Need help!

I looked through the guide, I changed decreasing to counter and it says i needs to be declared!

I'm so confused!
Risen123




PostPosted: Thu Nov 08, 2012 7:10 pm   Post subject: RE:Need help!

Ok I got #1 and #4, thank you!
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 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: