pascal help

March 15, 2010 at 20:27:35
Specs: Windows XP
ok so i need a lot of help quick! we have to write a code called multiplication table using for loop statements. It should look like this:
Multiplication Table
------------------------
----|----1----2----3----4----5
---------------------------------
--1--|----1----2----3----4----5
--2--|----2----4----6----8----10
(this will go on to 5. the dashes represent spaces)
we have to prompt for the size which is 5, print the header which is "multiplication header", print the column headers which is the first line and the row numbers which are the rest of the numbers. We have to do this in a nested loop. PLEASE HELP ME WRITE THIS! i know how to prompt and do for loop statements but am totally confused right now. THANK YOU SO MUCH! :)

See More: pascal help

Report •


#1
March 16, 2010 at 07:56:45
Program MULTAB;

uses CRT;

var
  size, i, j:integer;

Begin

WriteLn;
Write ('  Enter the size of the table >'); ReadLn (size);
ClrScr;

WriteLn;
WriteLn ('MULTIPLICATION TABLE':30);
WriteLn;

Write ('     |');
for i:=1 to size do write (i:5);
WriteLn;
Write ('-----+');
for i:=1 to size do write ('-----');
WriteLn;

for i:=1 to size do begin
  Write (i:3, '|':3);
  for j:=1 to size do write (i*j:5);
  WriteLn
end

End.


Report •

#2
March 16, 2010 at 17:24:12
wow thanx but i don't get why there's a plus sign and a star
?????
but THANX A LOT

Report •

#3
March 16, 2010 at 17:26:00
wait never mind the star is the multiplication sign but why the plus sign? is it because u just made a mistake or what?

Report •

Related Solutions

#4
March 16, 2010 at 17:28:08
and if u don't mind but i'll be needing a lot of help lately cuz the teacher is absolutely horrible and she'll never help u if u need help! ahhhh i hate her so much

Report •

#5
March 17, 2010 at 02:27:21
Did you compile the source code and then run the load module? The resulting pattern, if entered 7, is the following table

          MULTIPLICATION TABLE

     |    1    2    3    4    5    6    7
-----+-----------------------------------
  1  |    1    2    3    4    5    6    7
  2  |    2    4    6    8   10   12   14
  3  |    3    6    9   12   15   18   21
  4  |    4    8   12   16   20   24   28
  5  |    5   10   15   20   25   30   35
  6  |    6   12   18   24   30   36   42
  7  |    7   14   21   28   35   42   49

As you can see the plus symbol is used to cross the horizontal and vertical separation lines. It is not used as a math operator here.

I always post working solutions and I suggest you don't relay too much on luck as to get homework done on Computing.net is not usual.

If your compiler (which one?) doesn't support the CRT unit, remove

uses CRT;

and

ClrScr;


Report •

#6
March 17, 2010 at 18:51:23
yea i already finished we had to do it for up to five and up to twelve. i noticed that i did everything right except that i forgot that little writeln at the ending. well anyways thanx a lot. if you seriously don't mind, will u like help me for my other projects as well? i'm only in middle school u know.....

Report •

#7
March 18, 2010 at 03:31:57

Check your mail in-box


Report •


Ask Question