Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Pascal:Seating plan Posted by gadda on 23 Aug 2005 at 1:54 AM
Makers are required to write a computer program for the school annual dinner registration. During the data collection stage, personal information of the participants is required to be input into the program,i.e. name of the participants, sex,age.

The program should validate all input data and also have functions to amend the input data

At the end of the registration period, the program should generate a seating plan of the anniversary dinner for the organising committee in a text file. Makers should clearly define the seat allocation rules and any other system parameters such as table size. Some possible seat allocation rules are as follow:

1.Grouping family members together
2.balancing male and female participants
3.grouping similar age participants
4.grouping similar employment participants

The program should consider at least TWO seat allocation rules at the same time to generate a seating plan .
Report
Re: Pascal:Seating plan Posted by gadda on 23 Aug 2005 at 1:57 AM
: Makers are required to write a computer program for the school annual dinner registration. During the data collection stage, personal information of the participants is required to be input into the program,i.e. name of the participants, sex,age.
:
: The program should validate all input data and also have functions to amend the input data
:
: At the end of the registration period, the program should generate a seating plan of the anniversary dinner for the organising committee in a text file. Makers should clearly define the seat allocation rules and any other system parameters such as table size. Some possible seat allocation rules are as follow:
:
: 1.Grouping family members together
: 2.balancing male and female participants
: 3.grouping similar age participants
: 4.grouping similar employment participants
:
: The program should consider at least TWO seat allocation rules at the same time to generate a seating plan .
:


i don't know how to make some allocation rule, for example,1 and 2.
also, i don't know how to combine them
Report
Re: Pascal:Seating plan Posted by Phat Nat on 24 Aug 2005 at 5:13 PM
: : At the end of the registration period, the program should generate a seating plan of the anniversary dinner for the organising committee in a text file. Makers should clearly define the seat allocation rules and any other system parameters such as table size. Some possible seat allocation rules are as follow:
: :
: : 1.Grouping family members together
: : 2.balancing male and female participants
: : 3.grouping similar age participants
: : 4.grouping similar employment participants
: :
: : The program should consider at least TWO seat allocation rules at the same time to generate a seating plan .
: :
:
:
: i don't know how to make some allocation rule, for example,1 and 2.
: also, i don't know how to combine them

Is this being done in TP for Windows as well? I think you can find some database functions with TPW, but like most here,I work in TP for DOS.

In DOS, I would create a procedure (or routines in a main sorting procedure) for each allocation rule. They would read from the database in the order that they are in and rearrange them into the output for that function. Then to run more than one rule, just call them in reverse order. For example, say we have the following data:

Jane       Smith       F    28
John       Doe         M    46
Joe        Smith       M    32
Edward     Mally       M    64
Tina       Zerod       F    18
Alice      Doe         F    45
Ashley     Doe         F    16
Mark       Zerod       M    53


Say we want to order them by Family First, then Age.
If we run it through the Age procedure first, then our list will look like so:
Edward     Mally       M    64
Mark       Zerod       M    53
John       Doe         M    46
Alice      Doe         F    45
Joe        Smith       M    32
Jane       Smith       F    28
Tina       Zerod       F    18
Ashley     Doe         F    16


Now, if we run it through the Family procedure, we will get this:
Edward     Mally       M    64
Mark       Zerod       M    53
Tina       Zerod       F    18
John       Doe         M    46
Alice      Doe         F    45
Ashley     Doe         F    16
Joe        Smith       M    32
Jane       Smith       F    28


Therefore, we can run it through as many rules as we want and it will come out correctly ordered.

Now all you need to do is write a procedure for each. Family should be easy by comparing last name, sex is just a single character comparison, age is simply number comparisons, and if you have a list of occupations that they can choose from, then that will be easy too, otherwise you will need a cross-reference for related fields, etc.

Also, when doing character/string comparisons, make sure you convert them to all uppercase (or lowercase) first before comparing.

Phat Nat

Report
Re: Pascal:Seating plan Posted by gadda on 25 Aug 2005 at 7:54 AM
: : : At the end of the registration period, the program should generate a seating plan of the anniversary dinner for the organising committee in a text file. Makers should clearly define the seat allocation rules and any other system parameters such as table size. Some possible seat allocation rules are as follow:
: : :
: : : 1.Grouping family members together
: : : 2.balancing male and female participants
: : : 3.grouping similar age participants
: : : 4.grouping similar employment participants
: : :
: : : The program should consider at least TWO seat allocation rules at the same time to generate a seating plan .
: : :
: :
: :
: : i don't know how to make some allocation rule, for example,1 and 2.
: : also, i don't know how to combine them
:
: Is this being done in TP for Windows as well? I think you can find some database functions with TPW, but like most here,I work in TP for DOS.
:
: In DOS, I would create a procedure (or routines in a main sorting procedure) for each allocation rule. They would read from the database in the order that they are in and rearrange them into the output for that function. Then to run more than one rule, just call them in reverse order. For example, say we have the following data:
:
:
: Jane       Smith       F    28
: John       Doe         M    46
: Joe        Smith       M    32
: Edward     Mally       M    64
: Tina       Zerod       F    18
: Alice      Doe         F    45
: Ashley     Doe         F    16
: Mark       Zerod       M    53
: 

:
: Say we want to order them by Family First, then Age.
: If we run it through the Age procedure first, then our list will look like so:
:
: Edward     Mally       M    64
: Mark       Zerod       M    53
: John       Doe         M    46
: Alice      Doe         F    45
: Joe        Smith       M    32
: Jane       Smith       F    28
: Tina       Zerod       F    18
: Ashley     Doe         F    16
: 

:
: Now, if we run it through the Family procedure, we will get this:
:
: Edward     Mally       M    64
: Mark       Zerod       M    53
: Tina       Zerod       F    18
: John       Doe         M    46
: Alice      Doe         F    45
: Ashley     Doe         F    16
: Joe        Smith       M    32
: Jane       Smith       F    28
: 

:
: Therefore, we can run it through as many rules as we want and it will come out correctly ordered.
:
: Now all you need to do is write a procedure for each. Family should be easy by comparing last name, sex is just a single character comparison, age is simply number comparisons, and if you have a list of occupations that they can choose from, then that will be easy too, otherwise you will need a cross-reference for related fields, etc.
:
: Also, when doing character/string comparisons, make sure you convert them to all uppercase (or lowercase) first before comparing.
:
: Phat Nat
:
:
thx, i think i have a basic concept of the program.
Report
Re: Pascal:Seating plan Posted by gadda on 25 Aug 2005 at 7:58 AM
: : : : At the end of the registration period, the program should generate a seating plan of the anniversary dinner for the organising committee in a text file. Makers should clearly define the seat allocation rules and any other system parameters such as table size. Some possible seat allocation rules are as follow:
: : : :
: : : : 1.Grouping family members together
: : : : 2.balancing male and female participants
: : : : 3.grouping similar age participants
: : : : 4.grouping similar employment participants
: : : :
: : : : The program should consider at least TWO seat allocation rules at the same time to generate a seating plan .
: : : :
: : :
: : :
: : : i don't know how to make some allocation rule, for example,1 and 2.
: : : also, i don't know how to combine them
: :
: : Is this being done in TP for Windows as well? I think you can find some database functions with TPW, but like most here,I work in TP for DOS.
: :
: : In DOS, I would create a procedure (or routines in a main sorting procedure) for each allocation rule. They would read from the database in the order that they are in and rearrange them into the output for that function. Then to run more than one rule, just call them in reverse order. For example, say we have the following data:
: :
: :
: : Jane       Smith       F    28
: : John       Doe         M    46
: : Joe        Smith       M    32
: : Edward     Mally       M    64
: : Tina       Zerod       F    18
: : Alice      Doe         F    45
: : Ashley     Doe         F    16
: : Mark       Zerod       M    53
: : 

: :
: : Say we want to order them by Family First, then Age.
: : If we run it through the Age procedure first, then our list will look like so:
: :
: : Edward     Mally       M    64
: : Mark       Zerod       M    53
: : John       Doe         M    46
: : Alice      Doe         F    45
: : Joe        Smith       M    32
: : Jane       Smith       F    28
: : Tina       Zerod       F    18
: : Ashley     Doe         F    16
: : 

: :
: : Now, if we run it through the Family procedure, we will get this:
: :
: : Edward     Mally       M    64
: : Mark       Zerod       M    53
: : Tina       Zerod       F    18
: : John       Doe         M    46
: : Alice      Doe         F    45
: : Ashley     Doe         F    16
: : Joe        Smith       M    32
: : Jane       Smith       F    28
: : 

: :
: : Therefore, we can run it through as many rules as we want and it will come out correctly ordered.
: :
: : Now all you need to do is write a procedure for each. Family should be easy by comparing last name, sex is just a single character comparison, age is simply number comparisons, and if you have a list of occupations that they can choose from, then that will be easy too, otherwise you will need a cross-reference for related fields, etc.
: :
: : Also, when doing character/string comparisons, make sure you convert them to all uppercase (or lowercase) first before comparing.
: :
: : Phat Nat
: :
: :
: thx, i think i have a basic concept of the program.
:
Also, if i want to insert a picture in the program, how can i do?
Report
Re: Pascal:Seating plan Posted by Phat Nat on 25 Aug 2005 at 5:11 PM
: : : Now all you need to do is write a procedure for each. Family should be easy by comparing last name, sex is just a single character comparison, age is simply number comparisons, and if you have a list of occupations that they can choose from, then that will be easy too, otherwise you will need a cross-reference for related fields, etc.
: : :
: : : Also, when doing character/string comparisons, make sure you convert them to all uppercase (or lowercase) first before comparing.
: : :
: : : Phat Nat
: : :
: : :
: : thx, i think i have a basic concept of the program.
: :
: Also, if i want to insert a picture in the program, how can i do?
:

You're kind of asking on the wrong board (although this is the right board), I don't think any of us use TPW. Just TP for DOS and I believe Zibadian runs Delphi. Try searching the web with http://www.Google.com / http://www.Yahoo.com / http://www.Metacrawler.com /etc and see what come up.

Phat Nat

Report
Re: Pascal:Seating plan Posted by chengterry2005 on 10 Oct 2005 at 7:55 AM
: : : : Now all you need to do is write a procedure for each. Family should be easy by comparing last name, sex is just a single character comparison, age is simply number comparisons, and if you have a list of occupations that they can choose from, then that will be easy too, otherwise you will need a cross-reference for related fields, etc.
: : : :
: : : : Also, when doing character/string comparisons, make sure you convert them to all uppercase (or lowercase) first before comparing.
: : : :
: : : : Phat Nat
: : : :
: : : :
: : : thx, i think i have a basic concept of the program.
: : :
: : Also, if i want to insert a picture in the program, how can i do?
: :
:
: You're kind of asking on the wrong board (although this is the right board), I don't think any of us use TPW. Just TP for DOS and I believe Zibadian runs Delphi. Try searching the web with http://www.Google.com / http://www.Yahoo.com / http://www.Metacrawler.com /etc and see what come up.
:
: Phat Nat
:
:

hey gadda
you are cheating!!!You got wrong in asking for help in the CIT HKCEE Examination.You are so dog.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.