Skip to Content
Navigating C++ and Object-Oriented Design
book

Navigating C++ and Object-Oriented Design

by Paul Anderson, Gail Anderson
October 1997
Intermediate to advanced
800 pages
20h 48m
English
Pearson
Content preview from Navigating C++ and Object-Oriented Design

2.9. Exercises

1:Write a C++ program that reads characters from your keyboard, up to a newline character. Display the following information:
Number of uppercase characters.
Number of lowercase characters.
Number of digits.
Number of other characters.
Total number of characters.
2:Write a C++ program that displays the sequence
2 4 6 8 10 20 22 24 26 28 30 40 42 44 46 48 50 60

using only a for loop, the conditional operator (?:), and cout statements.

3:Write a C++ program that populates a two-dimensional array with integers, 1 through 50. Use a pointer to print out the values stored in the array. Have your program produce the following output.
 1 2 3 4 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exploring C++20: The Programmer's Introduction to C++

Exploring C++20: The Programmer's Introduction to C++

Ray Lischner

Publisher Resources

ISBN: 0135327482Purchase book