Computer Science I Programming and Problem Solving - Project 3 | CS 23021, Study Guides, Projects, Research of Computer Science

Material Type: Project; Class: CS I PROG/PROBLEM SOLVING; Subject: Computer Science; University: Kent State University; Term: Fall 2008;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/01/2009

koofers-user-zxi
koofers-user-zxi 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS23021 Computer Science I
Project #3
Due by 11:59pm on Monday, November 24, 2008
You will write two programs in this project. The f irst program “sort” eliminates double entries in the
sequence of integers. The second program “fixer” corrects syntax errors in English text.
Sorter. Write a program that accep ts a sequence of integers (some of which may repeat) as input and
prints out the integers in sorted order using an “Insertion Sort” algorithm. You can assume that there are no
more than 20 integers in the input, but there may be less. Zero signif ies the end of inpu t. It should be NOT
printed.
For example, when the following input is provided to your program:
5 6 22 2 5 22 7 6 0
your program should print:
2 5 5 6 6 7 22 22
You must use an array to store the numbers. Place your program in a single file na med: sorter.cpp
Fixer. Write a program that reads English text. Th e program should output the text with spacing corrected
and with letters corrected for capitalization (i.e. th e first letter of the first word in a sentence must b e
capitalized, but subsequent words are not capitalized). In particular, in the output tex t all strings of two or
more blank spaces should be compressed to a single blank. A sen tence (a letter starting the text and
following a dot) should start with an uppercase letter. There should be a space after a comma or a dot. No
other formatting is required. Assume that a comma or a dot always follow a number or a letter (i.e. cannot
be proceeded by a space or other punctuation mark).
For example, the input:
the Answer to life,the Universe, and everything is 42.
Should produce the following output:
The answer to life, the universe, and everything is 42.
Empty line signifies the end of input. This empty line should NOT be output.
You must use a C++ string to store a line of input. Place your program in single file named: fixer.cpp
Submit your project into the subvers ion repository under subdirectory Project3. Note that for each
program you have to create a separa te project for each of the above programs and deposit these pro jects in
Project3 subdirectory.

Partial preview of the text

Download Computer Science I Programming and Problem Solving - Project 3 | CS 23021 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

CS23021 Computer Science I

Project

Due by 11:59pm on Monday, November 24, 2008

You will write two programs in this project. The first program “sort” eliminates double entries in the sequence of integers. The second program “fixer” corrects syntax errors in English text. Sorter. Write a program that accepts a sequence of integers (some of which may repeat) as input and prints out the integers in sorted order using an “Insertion Sort” algorithm. You can assume that there are no more than 20 integers in the input, but there may be less. Zero signifies the end of input. It should be NOT printed. For example, when the following input is provided to your program: 5 6 22 2 5 22 7 6 0 your program should print: 2 5 5 6 6 7 22 22 You must use an array to store the numbers. Place your program in a single file named: sorter.cpp Fixer. Write a program that reads English text. The program should output the text with spacing corrected and with letters corrected for capitalization (i.e. the first letter of the first word in a sentence must be capitalized, but subsequent words are not capitalized). In particular, in the output text all strings of two or more blank spaces should be compressed to a single blank. A sentence (a letter starting the text and following a dot) should start with an uppercase letter. There should be a space after a comma or a dot. No other formatting is required. Assume that a comma or a dot always follow a number or a letter (i.e. cannot be proceeded by a space or other punctuation mark). For example, the input: the Answer to life,the Universe, and everything is 42. Should produce the following output: The answer to life, the universe, and everything is 42. Empty line signifies the end of input. This empty line should NOT be output. You must use a C++ string to store a line of input. Place your program in single file named: fixer.cpp Submit your project into the subversion repository under subdirectory Project3. Note that for each program you have to create a separate project for each of the above programs and deposit these projects in Project3 subdirectory.