Turbo pascal homework

Reply

Join Date: Feb 2005
Posts: 2
Reputation: Paramaribo is an unknown quantity at this point 
Solved Threads: 0
Paramaribo Paramaribo is offline Offline
Newbie Poster

Turbo pascal homework

 
0
  #1
Feb 22nd, 2005
Hi,

I don't want anyone to do my assignment for me, I just want some help.

I'm a student in Suriname, formerly Dutch-Guiana. My teacher decided that we should learn how to write basic programs in Turbo Pascal to improve our "problemsolving skills" and for so far things have gone swimmingly. today i received an assignment:

http://img.photobucket.com/albums/v7...Scanned-01.jpg

I can do the first part (having the program read in all the info), I just don't know how to create a table (figure 1 and 2) or the "certificate". I've never seen that before. I've tried to look it up in some books in our library, but I've found nothing because I have no idea what I'm looking for. so can anyone just give me a word that I can look up, i don't want you to write my program, I just want a word (I'm that desperate for help :o ).
Thank you for reading this!
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 45
Reputation: Siersan is an unknown quantity at this point 
Solved Threads: 2
Siersan's Avatar
Siersan Siersan is offline Offline
Speaker of Truth

Re: Turbo pascal homework

 
0
  #2
Feb 22nd, 2005
How you print the table depends on how you set up your table of records. If it's actually an array of records then you're looking at a loop like this:
Pascal and Delphi Syntax (Toggle Plain Text)
  1. writeln('Summary of Student Course Scores:')
  2. writeln('ID NAME CLASSICAL REGGAE ROCK TOTAL AVERAGE');
  3. for i := 1 to N do
  4. writeln(s[i].id, s[i].name, s[i].classical, s[i].rock, s[i].total, s[i].average);
I'll let you work out the formatting issues as that tends to be more trial and error than anything.

I would imagine that the certificate itself is something simple along these lines:
Pascal and Delphi Syntax (Toggle Plain Text)
  1. writeln('*GOLD*\nCERTIFICATE OF OUTSTANDING\nACHIEVEMENT');
  2. writeln('\n\n', highest.name, '\n\nIn Music Studies\n');
Once again, the formatting itself so that everything is centered I will leave to you.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 2
Reputation: Paramaribo is an unknown quantity at this point 
Solved Threads: 0
Paramaribo Paramaribo is offline Offline
Newbie Poster

Re: Turbo pascal homework

 
0
  #3
Feb 27th, 2005
Thanks, your advice was really helpfull. I have on last question, if you don't mind.

Here's the last part of my program:

highestavegrade := avegradestudent[1];
FOR i:=2 TO 10 DO
BEGIN
IF avegradestudent[i] >= highestavegrade
THEN highestavegrade := avegradestudent[i];
END;
FOR i:=1 TO 10 DO
BEGIN
IF avegradestudent[i] >= highestavegrade
THEN writeln (*GOLD*, etc, etc

When I run the program all the names of the students appear, instead of the one with the highest average (Jack Bean). What am I doing wrong?
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 31
Reputation: Jackrabbit is an unknown quantity at this point 
Solved Threads: 0
Jackrabbit Jackrabbit is offline Offline
Light Poster

Re: Turbo pascal homework

 
0
  #4
Mar 3rd, 2005
Pascal and Delphi Syntax (Toggle Plain Text)
  1. highestavegrade := 0;
  2.  
  3. for i:=1 to 10 do
  4. begin
  5. if avegradestudent[i] > highestavegrade then
  6. begin
  7. highestavegrade := avegradestudent[i];
  8. end;
  9. end;
  10.  
  11. for i:=1 to 10 do
  12. begin
  13. if avegradestudent[i] = highestavegrade then
  14. begin
  15. { writeln (*GOLD*, etc, etc }
  16. end;
  17. end;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 4774 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC