Homework 2 - Fun With Strings, Characters, and Arithmetic

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online