Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

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

Report
PLEASE HELP ASAP! Posted by xxhappieangelx on 15 Apr 2004 at 9:24 PM
The local high school sports boosters are conducting a fund drive to help raise money for the athletic program. As each donation is recieved, the person's name and amount of donation are entered on one line in a data file. Write a program to
a. print an alphabetical list of all donars together with their correspoding donation
b. print a list from highest to lowest with the donars' names
c. compute and print the average and total of all donations

PLEASE!!!
Report
Re: PLEASE HELP ASAP! Posted by Phat Nat on 15 Apr 2004 at 11:34 PM
: The local high school sports boosters are conducting a fund drive to help raise money for the athletic program. As each donation is recieved, the person's name and amount of donation are entered on one line in a data file. Write a program to
: a. print an alphabetical list of all donars together with their correspoding donation
: b. print a list from highest to lowest with the donars' names
: c. compute and print the average and total of all donations
:
: PLEASE!!!
:

Well, to start with you are going to need to load the data from the file into an array. The array should be of a customized record type that defines two variables: Name : String and Donation : Real. The array size will be determined by the maximum number of donations.

Next, you need to create a menu and ask the user to choose which option they wish to see. Some simple writeln() procedures followed by a readkey call should accomplish this.
The result of the readkey call should then call the corresponding procedure by using if...then statements or a case statement.

Then each procedure will have to sort the data or average it out as required and show the result.

Try to write the code and if you get stuck, post what you wrote. You won't learn if you don't try yourself, but we are more than happy to help you along.

Phat Nat




 

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.