Computer Science Canada Help! |
Author: | Thanos [ 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 ) :
|
Author: | Izzy [ Fri Jan 03, 2003 6:16 pm ] | ||
Post subject: | |||
Heya.
Instead of putting the spaces in which will throw off the spacing when the digits increase (one digit, two and so on) use what i put, take a look at it, i'm sure you can figure out what it does - Izzy |
Author: | Tony [ Fri Jan 03, 2003 6:47 pm ] |
Post 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. |
Author: | Izzy [ Fri Jan 03, 2003 6:59 pm ] | ||
Post subject: | |||
Heya. I figured I would tell you this aswell, just an expansion on the current subject, and you might need it
When you add a second : number on it formats the decimal place. So for are real number 11.116 it will hold the 10 spaces for the number then format the decimal place to two digits. Thus the output would be 11.12 (Don't hold me on the spacing ) - Izzy |