Copyright 8 1995 by Douglas E. Woolley
All rights reserved.
Printed in the United States of America.
University of South Florida
Center for Excellence
Tampa, FL 33620
Cover and graphics: Gene Minish
ENDORSEMENTS
Computer-based technology is everyone's future. Developing expertise in the area of analytical thinking, problem solving, and programming will greatly aid individuals to meet the challenges to come. This book can help contribute to the expansion of the use of computer technology in any school district that is willing to use and apply its contents.
George M.C. Fisher
Chairman, President & CEO of Eastman Kodak Company
For the information highway to become a reality, today's students must be academically challenged. They must be encouraged to participate and learn from simulated business problems by attempting to solve those problems in an environment where they can compete with their peers. This concept, and the notion of having a book to refer to in order to train in anticipation of the contest, are very innovative concepts that will assist the students in learning more about the real business world. The thought of a computer contest containing simulated business problems should also stimulate interest in the students to continue their education in the field of information technology.
Don A. Hayes
Vice President of GTE Information Technology &
President of GTE Data Services
Doug Woolley is the finest computer programming student I have met in seventeen years of teaching. He has compiled the State Contest problems into an impressive reference work. The problems are original, varied in content and difficulty, and test all important programming concepts. This work should serve as a rich source of interesting problems for training the next generation of programmers.
Robert D. Rosen
Teacher and Sponsor of the winning FHSCC team in 1985
Author of Apple Machine Language
Stoneman Douglas High School
Common sense dictates that the more "at home" a computer programming team feels with the competition material, the better they will do. In preparing my team for state competition, I try to simulate as closely as possible the actual conditions under which they will compete. To do this, practicing with problems from past state contests is a MUST. The problems included in this book, as well as their solutions, are invaluable tools that will definitely strengthen the precision of my team's preparation!
Loretta Boyett
Teacher and Sponsor of the winning FHSCC team in 1994
Taravella High School
Dedicated To
DR. ANDRIA P. TROUTMAN,
who first gave me the opportunity to
write the problems and
develop the judging criteria for the
Florida High Schools Computing Competition
and
DR. CARL D. RIGGS,
who has supported and helped finance
the contest
and my educational experiences.
GUIDELINES FOR PROGRAMMING AND JUDGING
Part One: PROBLEMS
1. 1985 .................................................................. 1
2. 1986 .................................................................. 17
3. 1987 .................................................................. 33
4. 1988 .................................................................. 46
5. 1989 .................................................................. 62
6. 1990 .................................................................. 78
7. 1991 .................................................................. 97
8. 1992 .................................................................. 115
9. 1993 .................................................................. 136
10. 1994 .................................................................. 155
Part Two: JUDGING CRITERIA
1. 1985 .................................................................. 1
2. 1986 .................................................................. 14
3. 1987 .................................................................. 30
4. 1988 .................................................................. 44
5. 1989 .................................................................. 56
6. 1990 .................................................................. 69
7. 1991 .................................................................. 82
8. 1992 .................................................................. 100
9. 1993 .................................................................. 117
10. 1994 .................................................................. 129
Part Three: BASIC PROGRAM SOLUTIONS
1. 1985 .................................................................. 1
2. 1986 .................................................................. 20
3. 1987 .................................................................. 40
4. 1988 .................................................................. 61
5. 1989 .................................................................. 80
6. 1990 .................................................................. 99
7. 1991 .................................................................. 117
8. 1992 .................................................................. 134
9. 1993 .................................................................. 154
10. 1994 .................................................................. 174
Part Four: PASCAL PROGRAM SOLUTIONS
1. 1985 .................................................................. 1
2. 1986 .................................................................. 28
3. 1987 .................................................................. 56
4. 1988 .................................................................. 84
5. 1989 .................................................................. 113
6. 1990 .................................................................. 140
7. 1991 .................................................................. 163
8. 1992 .................................................................. 185
9. 1993 .................................................................. 208
10. 1994 .................................................................. 236
The Florida High Schools Computing Competition (FHSCC) is an annual statewide programming contest that originated in 1980. Over the years the event has been jointly sponsored by the Center for Excellence in Mathematics, Science, Computers, and Technology (CEMSCT); the Florida Center for Instructional Computing (FCIC); the Florida Department of Education; and GTE Data Services.
Each year, programming competitions are held at the county level in order to select the best high school teams to participate in the state competition. Each team consists of at most four high school students and one microcomputer of their choice. The FHSCC normally consists of 30 programming problems of varying difficulty: 10 one‑point programs, 10 two‑point programs, and 10 three‑point programs. Teams have three hours to complete as many programs as possible. Until 1988, programming was done exclusively in BASIC. Since then, programs may also be written in Pascal. Judges determine if a team has a correct solution to a problem, based on sample input and output. The team that has accumulated the greatest number of points is declared the winner.
These contests enable students to demonstrate their problem solving and programming skills in a competitive environment. From experience, I know the thrill of preparing a team for a computer contest of such a high caliber. The anticipation of competing in the FHSCC has motivated many students to develop their computer skills beyond what is required in the normal school curriculum. Furthermore, the benefits of working together as a team to solve problems cannot be underestimated. Technical skills and people skills go side by side in the real job world.
Over the years a need has arisen to have a single book that contains the problems and solutions from previous programming contests. The task has been completed by writing and compiling the contents of this book. The first part contains the contest problems as they appeared at previous competitions, with some minor editing. The second part contains the judging criteria for each problem that appeared in previous judging packets, with extensive editing to conform the older items to the new standards. The last two parts make up the majority of the book and include the BASIC and Pascal program solutions for each contest problem, written in QuickBASIC 4.5 and Turbo Pascal 7.0, respectively. All of these solutions were written by me over the past few years. It is my hope that high school students, teams, county contest coordinators, and state contest coordinators in Florida and throughout the nation will make use of this material.
Douglas E. Woolley
Author and Official Judge of the FHSCC (1985 ‑ 1994)
Tampa, Florida
January, 1995
I first met Doug Woolley in 1984, when he was the captain of the winning team at the fifth annual Florida High School Computer Contest (FHSCC). Well, Doug's team did more than just win--they achieved a perfect score. No other team has ever come close to that performance, before or since. You see, the contests were (and are) written with the specific intent that no team can possibly answer all the problems correctly within the time allotted (I know, because I helped to write some of them.) Only after coming to know Doug better, coming to know that he had for some years collected programming items from all over the country with something approaching religious fervor, coming to know that he was (and is) a true connoisseur of programming contest items ("but you see, Jim, item #12 on FHSCC'84 is very similar to #19 on Wisconsin '82--the devise required to solve it in a real time frame is quite unusual"), coming to know that he had personally worked out all the solutions to all the programs that he had collected, coming to know that he had performed very well in many different state and national programming and mathematics competitions, coming to know that he had been selected as one of the top 300 high school scientists in America by Westinghouse Science Talent Search, for which he wrote (incidentally teaching himself enough mathematics group theory to code the algorithms) a program that tells you graphically how to solve Rubik's cube step-by-step, and coming to know that he had also achieved a perfect score on the mathematics subsection of the SAT, did the enigma unravel itself.
After the contest in 1984, Dr. Andria Troutman, then director of the Florida Center for Instructional Computing, approached Doug about coming to study at USF, only to find that he was headed to another school because they were offering a better financial package. Well, if you know Andria Troutman at all, you will not be surprised to know that, with a considerable amount of help from Dr. Carl Riggs, Doug was soon lured to enroll in the College of Engineering at USF. Over the next few years, Doug made himself a fixture at USF; writing and judging the computer contest, developing programs for contract and grant activities, coding programs for a textbook that Andria Troutman and I wrote, and for a second version of it that we wrote with Dr. Frank Breit, making presentations at the Florida Instructional Computing Conference (FICC, at that time) and to other groups, and (in his spare time, it seems) pursuing a degree in computer science with a minor in mathematics.
All good things must come to an end and Doug graduated. USF's loss was NCNB's gain when he began to program for them, instead. ("Jim, they actually pay me to write programs!!") Although he has made transitions from USF to NCNB (presently NationsBank) and now to GTE Data Services, FHSCC didn't lose Doug. Throughout the years, as the interest and involvement of others waxed and waned, Doug remained steadfast, Doug wrote and judged that contest. He continues to do so, giving freely of his time.
Know you then that this book is Doug's piece de resistance. You may savor it as you would a rare text or a fine wine, but above all else, read it and use it because that is what Doug wants. If you gain from it even a small fraction of the value that Doug put into it, or the satisfaction that he got from writing it, then I know that he will be happy.
James A. White, Ph.D.
Tampa, Florida
January 10, 1995
P.S. Doug's list of accomplishments sounds like he's about ready to retire. He's only 28.
Very few books are ever written without the inspiration and contribution of others. This book is no exception. Since much of the contents are a compilation of previous contests, it is appropriate to mention the history behind the contest.
The Florida High Schools Computing Competition (FHSCC) began as an extension of calculator contests that were sponsored by the University of South Florida in the 1970's. When the microcomputer became popular in the high schools, the format of the calculator contest was changed to computers. The computer contests were statewide and were designed to enable students to demonstrate their programming skills. Each team consisted of four high school students and a sponsor. The contest has normally consisted of 30 programs of varying difficulty to be completed within a three-hour time limit.
The first Computer Contest was held at the University of South Florida in Tampa in 1980. Five teams participated that year. The contest was held at USF in 1981 and 1982 and was held at Jefferson High School in Tampa in 1983. These contests were coordinated by Dr. C. W. Engel, a professor at USF, and graduate students from the Instructional Computing Program at the University. A great deal of help was provided by University professors, teachers in the Hillsborough School District, and local computer vendors.
The fifth FHSCC was held on Friday, May 4, 1984, at the Pasco‑Hernando Community College. The contest was coordinated by Dr. Angela L. Molina and Ms. Stephanie Van DeVenter of the Florida Center for Instructional Computing (FCIC), under the direction of Dr. Andria Troutman. I am very thankful to Dr. Andria Troutman for offering me a job at FCIC shortly after my high school's team won the contest.
Since 1985, I have served as the principal author and official judge of the FHSCC. I am grateful to many people who have helped in making these contests a success. In 1985, Dr. Andria Troutman and Elmo Price helped author the contest problems. In 1986, most of the programming problems were contributed by Jack Maxwell, professor at Indian River College. In 1987, I was assisted by USF Mathematics professor Jon Snader. Much credit must be given to Kim Przywara, Jarv Vickers (former contest coordinator), and Jim White (former director of FCIC) for their help in editing a few of the contests. I would like to thank Dr. Rick Austin from USF and several of my co-workers at GTE Data Services who helped contribute contest items for the 1994 FHSCC and who assisted in proof reading the final draft: Justin Hull, Jim McConnell, Tim McDonald, Mike Nichols, Bobby Wallace, and Bill Whitney.
From the years 1985 through 1992, all contests were held on the USF campus except for two: In 1988 and 1989 they were held at the University of Central Florida in Orlando and at the University of Florida in Gainesville, respectively. Since 1993, the competition has been held in the Tampa Convention Center.
From 1984 to 1991, the contests were jointly sponsored by FCIC and the Center for Excellence in Mathematics, Science, Computers, and Technology (CEMSCT) at the University of South Florida. This CEMSCT is under the direction of Dr. Carl D. Riggs, former Vice President for Academic Affairs and later dean of the Graduate School of USF. From 1986 to 1992, funding was provided by the USF Center for Excellence supplemented by three of the other Florida Centers for Excellence (Florida Atlantic University, University of Central Florida, and University of Florida). I would like to thank the NCNB Application Services Department for providing me with support to author the FHSCC in 1990 and 1991.
Since 1992, GTE Data Services has teamed up with the CEMSCT and the Florida Department of Education as the sponsors of the annual competition. Gratitude is extended to John Harper, Manager of Communications at GTE Data Services, for his support in hosting and coordinating the contest in 1993 and 1994; and to Suzanne Rogers Moore, Acting Director of Development at USF, for her assistance in the coordination efforts during these same years.
Special thanks are extended to Jane Chang, Amy Noble, Ronda Ossman, and Glenda Womble for editing some of the contest problems for the book.
Douglas E. Woolley
January, 1995
FLORIDA HIGH SCHOOLS COMPUTING COMPETITION
For each program the format of the output must match exactly the format of the example output. The user friendliness of the input is optional. Consider this example contest item:
Write a program to print the sum and product of two given numbers. Example:
INPUT: Enter two numbers: 7,8
OUTPUT: SUM = 15
PRODUCT = 56
The input phrase "Enter two numbers: " is optional; however, the numbers 7 and 8 must be entered on the same line separated by a comma or a space. The output phrases "SUM = " and "PRODUCT = " are mandatory. Exactly one space precedes and succeeds the equal sign. All input and output are in UPPERCASE.
If the content of an output is incorrect, the judge will say:
INCORRECT
If only the format of an output is incorrect, the judge will say:
INCORRECT FORMAT
Return to
FHSCC Book