CS 105 (C++)

Assignment 1: Colossus Mode






THIS IS THE VOICE OF WORLD CONTROL. I BRING YOU PEACE. IT MAY BE THE PEACE OF PLENTY AND CONTENT OR THE PEACE OF UNBURIED DEATH. THE CHOICE IS YOURS: OBEY ME AND LIVE, OR DISOBEY AND DIE.

- Colossus (Colossus: The Forbin Project)


I. Overview


In older science fiction movies, computer output was always in all capital letters. Your goal in this assignment is to write a program that capitalizes all letters in its input (i.e., converts text to Colossus mode).  There are many ways to accomplish this, but for this assignment, process the input characters one at a time (as in the examples in the reading) until EOF is received.

In addition, to exercise a few of the other important skills from Chapter 1, you'll have to count how many of each numeral the input contains, and print out the totals at the end of your output.

For example, given the input:

All commercial television and radio transmission facilities throughout the world will be tied into my communications system by 1000 hours Friday. At that time I will state my intentions for the future of mankind.

your program's output should be something like the following:

ALL COMMERCIAL TELEVISION AND RADIO TRANSMISSION FACILITIES THROUGHOUT THE WORLD WILL BE TIED INTO MY COMMUNICATIONS SYSTEM BY 1000 HOURS FRIDAY. AT THAT TIME I WILL STATE MY INTENTIONS FOR THE FUTURE OF MANKIND.
3
1
0
0
0
0
0
0
0
0

Note: If you send all of the input at once from a file, your output will look exactly like this.  If you enter your input directly from the keyboard, you'll see capitalized output each time you hit enter, then the numeral counts when you send Ctrl-D to end input.  (See Section III for details.)

Also, along the way, you'll need to learn some of the basics of using UNIX with C on the CS department UNIX machines.


II. Grading



III. The More You Know

The following are some additional items that may be very important for you to know about this assignment.



Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.