Computer Science Canada Check this out |
Author: | Mike [ Wed Nov 06, 2002 6:49 pm ] |
Post subject: | Check this out |
help with turing programs 1.Write a program that reads words entered one to a line and counts how many words have been entered before you give the signal word"end"to stop execution of the program. Experiment to determine what happens if you put several words on a line as you enter them. 2.Write a program that announces at each repetition of loop the number of times it has executed the loop. Have it stop at each execution with a message Type "more" to continue |
Author: | Mike Pastah [ Fri Nov 08, 2002 5:22 am ] | ||
Post subject: | |||
I don't get the first question, but I think this might help for the second:
|
Author: | Crimson_Hunter [ Fri Nov 22, 2002 6:52 pm ] | ||
Post subject: | |||
You are making it way too complicated. It goes like this:
|
Author: | moju [ Tue Nov 26, 2002 4:33 am ] |
Post subject: | REALLY EASY |
I HAD THE SAME ASSIGNMENTS AS YOU!!! [/code] var word:string var count:int word:="" count:=0 put "Word Counter" put "------------" put " " colour(12) %user prompt put "Enter words, then end with end" % loop to allow user to enter words loop get word % exit loop if word is "xxx" exit when word = "end" %increment counter count := count +1 end loop put "count is ",count |
Author: | moju [ Tue Nov 26, 2002 4:38 am ] |
Post subject: | |
[/b][/code] var num :real var more : string num :=1 loop put "Loop execution number, ", num put "Enter 'more' to continue" num := num +1 get more exit when more not= "more" end loop put "It execution stopped because you didn't type in 'more'" |
Author: | moju [ Tue Nov 26, 2002 4:41 am ] | ||
Post subject: | |||
|
Author: | Thanos [ Thu Nov 28, 2002 3:38 am ] |
Post subject: | |
LOL, are these assignments from the Turing textbook called "An Introduction to Programming in Turing" by J.N.P. Hume?hehe ![]() |