|
Overview
The purpose of this project is to apply skills develop throughout the course to a more complex task than typical one week lab assignments. Procedures
This assignment is worth three times as much as a standard lab. Write a program that will read in a text file (user specified) and format the text so that it is full justified. The user should be able to specify the number of characters per line (between 10 and 120). The results should be written to an output file (user specified). In the input file:
In the output file:
For example, if the following text were given to your program, and the line length were specified to be 40 characters: While I have not specified exactly how you should do the justification, part of your grade will be based on how visually pleasing your results are. As a general rule, you should strive to reduce the total number of spaces required and the maximum number of spaces between two words as much as possible. your program should produce an output file that is similar to the following: While I have not specified exactly how you should do the justification, part of your grade will be based on how visually pleasing your results are. As a general rule, you should strive to reduce the total number of spaces required and the maximum number of spaces between two words as much as possible. In addition, the following statistics should be appended to a log file:
Just for Fun
Although not required, you may choose to enhance your program with additional features. For example, you could add an option to select the number of characters to indent each paragraph or add a graphical user interface. Let your imagination run wild, but be sure to do the minimum requirements before embarking on any significant enhancements. Weekly logs (due 11:00pm, the day prior to weeks 9 and 10 labs)
You should submit activity logs each week to indicate your activity and progress on this assignment. Program Demonstration (last day of class)
You will be required to demonstrate your program at the beginning of the last day of class. Programs that are not ready to be demonstrated at the beginning of class will be considered late. In order to demonstrate your program, you will be given a set of input files and asked to run your program on them with specified line lengths. The output files and the log file should be zipped and submited (choose OTHER for assignment type) before the end of class. Lab report (due 11:00pm, the day prior to the last lecture)
Here is a template file to use as a starting point for this report. The lab report should be in your own words and self-contained. By self-contained I mean that it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor. Acknowledgment
This laboratory assignment was developed by Dr. Chris Taylor. |
© 2001-2015 Dr. Christopher C. Taylor | Office: CC-36C | Phone: 277-7339 |