PROJECT_3R - CS 31: INTRODUCTION TO COMPUTER SCIENCE I...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 31: INTRODUCTION TO COMPUTER SCIENCE I Computer Science Department University of California, Los Angeles Dr. John A. Rohr January 25, 2010 PROJECT 3 (REVISED) Writing C++ Programs to Manipulate Text Using Repetition & Functions Objective : Learn to write simple C++ programs that use repetition and functions to manipulate text. Assignment : Write a program to generate coded output strings from uncoded input strings. Use the following algorithm to encode a string of text where the first character of the string is the key character. Input : A key character followed by the characters of a string to be encoded. If the input string is empty, terminate the program. Output : The key character, the characters of the encoded message, and a four- decimal-digit checksum that is the sum modulo 10,000 of the output encoded characters. (The key character is not included in the checksum calculation) Algorithm : (Used separately on each character) 1. Get a character. 2. If the character code is zero or greater than 126, terminate encoding, generate the checksum, and append it to the output. 3.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

PROJECT_3R - CS 31: INTRODUCTION TO COMPUTER SCIENCE I...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online