[MSOE Homepage]

Dr. Taylor's MSOE homepage

Courses

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-100 Main page

CS-100 -- Final Project: Paragraph Justification

Fall Quarter 1999



Electrical Engineering and Computer Science Department
Dr. Christopher C. Taylor

S-331, 277-7339

www.msoe.edu/~taylor/

Purpose

The final project is designed to bring together many of the concepts discussed throughout the quarter.

Assignment

You are to write a program that will read input from a file (specified by the user) and write output to two separate files (also specified by the user). The input should consist of standard English sentences.

The first output file should consist of the same sentences as the input file; however, the output should be formatted such that there are two spaces after each sentence and all other words are separated by a single space. In addition, no line should be longer than sixty (60) characters. For example,

Input:

This course provides the students with a working
knowledge of the design
and implementation of computer programs to solve problems
encountered in
engineering practices.  Structured programming techniques
are introduced in this
course.  Particular emphasis is placed on
the discussion of problem
investigation, algorithm development, flowchart
development, pseudocode
development, coding, execution, debugging, and documentation. 
Topics include
data types, assignment statements, I/O statements,
I/O files, control
contructs, looping techniques, arrays and vectors,
user-defined functions,
library functions, and modules.  Data
visualization is also be discussed.
Problems related to engineering applications are emphasized.
 The
high-level computer language C++ is used to
illustrate and implement the topics. 

Output file 1:

This course provides the students with a working knowledge
of the design and implementation of computer programs to
solve problems encountered in engineering practices.
Structured programming techniques are introduced in this
course.  Particular emphasis is placed on the discussion of
problem investigation, algorithm development, flowchart
development, pseudocode development, coding, execution,
debugging, and documentation.  Topics include data types,
assignment statements, I/O statements, I/O files, control
contructs, looping techniques, arrays and vectors,
user-defined functions, library functions, and modules.
Data visualization is also be discussed.  Problems related
to engineering applications are emphasized.  The high-level
computer language C++ is used to illustrate and implement
the topics. 

The second output file should be similar to the first output file except that additional spaces should be added between words and sentences in order to make the paragraph fully justified. In other words, each line (except for the last line of the paragraph) should begin in column one and end in column 60. An example of the second output file given the input above is shown below:

Output file 2:

This  course provides the students  with a working knowledge
of the  design and  implementation of  computer  programs to
solve   problems   encountered  in  engineering   practices.
Structured  programming  techniques  are introduced  in this
course.   Particular emphasis is placed on the discussion of
problem  investigation,   algorithm  development,  flowchart
development,  pseudocode  development,   coding,  execution,
debugging,  and documentation.   Topics include  data types,
assignment statements,  I/O statements,  I/O files,  control
contructs,   looping   techniques,   arrays   and   vectors,
user-defined  functions,  library  functions,  and  modules.
Data visualization  is also be discussed.   Problems related
to engineering applications are emphasized.   The high-level
computer  language C++ is used  to illustrate  and implement
the topics. 
Your program should:

  • Attempt to additional spaces as evenly as possible. For example, it is unacceptable to produce the following output for file 2:
    ...
    computer    language C++ is used to illustrate and implement
    the topics. 
    
  • Make use of at least one function.
  • Be able to handle arbitraryly large input files.
  • Produce an error if the input file contains a word that is longer than 60 characters.

Lab report (due 4:00pm Friday, November 12, 1999)

This lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure (include the steps in your design procedure, reasons for your design decisions, etc.) Be sure to include a discussion of how you ensured that your program could work on an arbitrarily large input file.
  • Documented source code (you may wish to include this at the end of your report)
  • Sample program output
  • Conclusions (problems you encountered, what you learned, suggestions of how the project could be improved, things you would have done differently, etc.)

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 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.

Program demonstration (due 2:00pm Tuesday, November 16, 1999)

You will be required to demonstrate your program using input files provided by your instructor.

If you have any questions, consult the instructor.


This page was created by Dr. Christopher C. Taylor copyright 1999.