Author |
Message |
Risen123
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: Thu Nov 08, 2012 3:34 pm Post subject: RE:Need help! |
|
|
Somebody help please! |
|
|
|
|
![](images/spacer.gif) |
evildaddy911
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: Thu Nov 08, 2012 5:02 pm Post subject: RE:Need help! |
|
|
#1, #3, #6 if answered would be amazing! |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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". |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: 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
I tried making it increasing, didn't work
how do I fix it? ![Surprised Surprised](images/smiles/icon_surprised.gif) |
|
|
|
|
![](images/spacer.gif) |
Aange10
![](http://compsci.ca/v3/uploads/user_avatars/19166165534f400d42de502.png)
|
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
Risen123
|
Posted: Thu Nov 08, 2012 7:10 pm Post subject: RE:Need help! |
|
|
Ok I got #1 and #4, thank you! |
|
|
|
|
![](images/spacer.gif) |
|