Introduction to C++
Jonah Warrenjonah AT parsons DOT edu
http://www.feedtank.com/2005/cpp
Homework 2
(Please email me if you have any questions.)- Closely look over chapters 2 and 3. We should have covered this in the first two classes.
- Read Chapter 4. It will help next class.
- Review class code here.
- Create a program that asks the user to enter in a character. Print out three things.
- Print out the ASCII value of the character.
- Print out the previous character according to ASCII.
- Print out the next character according to ASCII.
- Create a program that asks the user to enter their height in inches. Convert the number they entered and give their height in feet and inches. HINT USE the DIVISION and MODULO operators.
- Create two arrays of floats. These arrays will represent the grades on a test for four
different students. Use the following data:
TEST 1: 89.3, 92.2, 76.9, 83.4 TEST 2: 73.4, 87.5, 81.3, 68.2
Using this data, create a program that does the following:
- Prints out the average score for each test (TEST1 avg, TEST2 avg).
- Ask the user to enter to enter a student number (between 0 and 3).
- Print out that students scores on TEST1, TEST2, and the average of these scores.
- Zip up questions 4,5 and 6. Post them to your website.