Homework 2 - Fun With Strings, Characters, and Arithmetic

# Homework 2 - Fun With Strings, Characters, and Arithmetic -...

This preview shows pages 1–3. Sign up to view the full content.

Homework 2 - Fun With Strings, Characters, and Arithmetic CS 171 Computer Programming I, Fall 2006 Sect: 60, 61, 501, 701 Homework 2 - Fun With Strings Instructor: Adelaida A. Medlock Due Date: Wednesday, October 25, 2006, 11:59 PM Late Due Date: Thursday, October 26, 2006, 11:59 PM PURPOSE: After completing this assignment, you will have experience manipulating string objects. THE ASSIGNMENT: This assignment consists of four sections: 1. Suggested problems (not to be turned in). 2. Written problems to be turned in. 3. A program to be completed. 4. Extra credit for the programming assignment. Click here to return to top of this page. . 1. Suggested Problems : From the Horstmann text: Chapter 2 (pp.70-78): R2.12, P2.11 Back to Top http://www.cs.drexel.edu/~mcs171/Fa06/assignments/HW2/index.htm (1 of 4)10/11/2006 4:03:30 PM

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

View Full Document
Homework 2 - Fun With Strings, Characters, and Arithmetic 2. Problems to be turned in : Because the purpose of this assignment is to gain experience with the specified objects and methods, you are to do each of these problems as described and not search for alternative approaches (no if statements, character arrays, apstring s, or atoi ). A. The char and int types allow mixed-mode arithmetic and assignment. For instance,the following code segment produces the letter 'e' as output: char ch = 'a'; ch = ch + 4 ; cout << ch << endl ; Using such arithmetic, write a segment of C++ code that will convert a lower-case letter to upper case. That is, if ch has the value ' f ', it will be changed to ' F '. You may assume the value of ch is a lower-case letter. B.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/17/2012 for the course CS 171 taught by Professor Adelaidaa.medlock during the Fall '06 term at Drexel.

### Page1 / 4

Homework 2 - Fun With Strings, Characters, and Arithmetic -...

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

View Full Document
Ask a homework question - tutors are online