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

Username:   Password: 
 RegisterRegister   
 I dont understand whats wrong please help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jesse Kazemi




PostPosted: Wed Jun 18, 2014 1:03 pm   Post subject: I dont understand whats wrong please help

What is it you are trying to achieve?

I am trying to develop a tile with squares in it


What is the problem you are having?
It keeps on saying that there is an error

Describe what you have tried to solve this problem

I have deleted things and added more stuff

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)



[syntax="turing"]

% Question 2: Develop a chart, with titles,
%containing the squares and cubes of the natural numbers from 5 to 40.
%*/
%
% Make title
put "A chart with the squares and cubes of natural numbers from 5 to 40."
for number : 5 .. 40
put "The square of " + number + " is: " + number ** 2
put "The cube of " + number + " is: " + number ** 3
end for



Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Jun 18, 2014 3:21 pm   Post subject: Re: I dont understand whats wrong please help

You can't use string concatenation (+ on strings) with an integer.

Use commas to give multiple arguments to put and let it do all the work of converting basic types to strings and print them.

Otherwise you must convert your integer to a string (see intstr) and the use + to concatenate the strings.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: