Delphi help

Toxcity

New member
Hello guys! :)

I need a little help from anyone who is good at Delphi.

This is my task..

"Write, compile and run a program to display an ‘n’ times table for a value of ‘n’ entered by the user. The output should be, for example if n=4:

1 x 4 = 4

2 x 4 = 8

3 x 4 = 12

……….

12 x 4 = 48

Hand in a listing and screen shot of the program’s output."

So far I have done this:

program Times_table;

{$APPTYPE CONSOLE}

uses

SysUtils;

var num :string[10];

var answer :integer;

begin

answer :=0;

Write('Welcome to the times table console, Press enter to continue.');

ReadLN;

WriteLn('Please enter a number you would like to multiply: ');

Readln (num);

answer := num * 1;

Write('2 x ',num'=',answer);

end.


I cannot get the maths to work... any ideas? Or help?

Thanks! :D
 
You cant multiply a String with an integer

U can loop it ... 1 sec ill just look up the delphi syntax



-------------------------------------------------------------------------------------------------------------​

program Times_table;

{$APPTYPE CONSOLE}

uses

SysUtils;

var num :integer;

var tr :integer; //to track the iteration of the loop

begin

Write('Welcome to the times table console, Press enter to continue.');

ReadLN;

WriteLn('Please enter a number for the times table you wish to produce: ');

Readln (num);

tr:=1;

// Loop 12 times

For tr:= 1 to 12 do

WriteLN(tr, ' x ',num,'= ',num * tr);

end.

-------------------------------------------------------------------------------------------------------------​
 
[not_relevant]The above shd work .. but i dont have a pascal/delphi compiler on my machine so i cant check[/not_relevant]

I installed the GNU PASCAL COMPILER

-- The above works
 
name='Toxcity' said:
Oh Joe you life saver! :)

i like whiskey + hookers i expect 2 boxes of each ;) [btw permapimp are a much better brand that heavenly Ho]

aka

no probs man .. i u need en other codin help dont be fraid to post it

p.s jameson or powers
 
joe said:
i like whiskey + hookers i expect 2 boxes of each [btw permapimp are a much better brand that heavenly Ho]

Lol it's easy to see that Joe's back. Nice one mate, reps for your help :worship:
 
name='PV5150' said:
Lol it's easy to see that Joe's back. Nice one mate, reps for your help :worship:

]

thanks man !!

(i know a shop that barters boxes of hookers in exchange of reps -- i use them there , probs they only stock dura-diseased branded ones )
 
name='Joe' said:
]

thanks man !!

(i know a shop that barters boxes of hookers in exchange of reps -- i use them there , probs they only stock dura-diseased branded ones )

Yeah Joe mate.

You got some repples from me too!

Just to let you know! ;)
 
Sorry for reviving this thread but I need help again! :(

I am rubbish at this.

Anywho, what I need to do is make a 7 segment display onscreen(Delphi form).

The teacher isn't much help... "Oh you should know all that".

Anyone know how to help?

Thanks! :)
 
Back again.. I need a shutdown command for Delphi...

Not the normal close one.. but a command that actually shuts down windows.

Cheers! :)
 
Back
Top