Help!
Author |
Message |
Thanos
|
Posted: Fri Jan 03, 2003 5:17 pm Post subject: Help! |
|
|
Hi everyone, im a beginner Turing Student and was wondering if you could help me with something. You can see what my problem is in the attatchment, thanks for taking ur time to read my msg. Here is my code (yea i know, it's crappy ) :
code: |
var count, sum, sumSq, sumCu := 0
put " Sum of the Sum of the squares Sum of the cubes"
put "N natural numbers of the nautral of the natural"
put " from 1 to N numbers from 1 to N numbers from 1 to N"
put repeat ("_", 80)
loop
count := count + 1
sum := sum + count
sumSq := sumSq + count ** 2
sumCu := sumCu + count ** 3
put count ..
put repeat (" ", 9), sum ..
put repeat (" ", 20), sumSq ..
put repeat (" ", 22), sumCu
exit when count = 10
end loop
|
Description: |
|
Filesize: |
116.58 KB |
Viewed: |
6011 Time(s) |
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Izzy
|
|
|
|
|
Tony
|
Posted: Fri Jan 03, 2003 6:47 pm Post subject: (No subject) |
|
|
hey Izzy, appretiate you helping people out keep it up
additional highlight of the code
put text:10
that :10 means that text will be displayed in a 10 character space. If text is under 10 characters in length, more spaces will be added to display it as a 10 characters string.
Note that if text is more then 10 characters in length, it will still be displayed at full and alighment will be broken.
If user inputs are to be aligned, it might be a good idea to run a sort to find the largest word and align based on its length.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Izzy
|
|
|
|
|
|
|