KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: January

Course Name: C++                    Lesson Name: Chap 10.2a

Student Name

Password


Objective
To complete the workbook problems.


Primary Focus
Answer the questions in the spaces provided below.

Site Links
Course Home Page

Additional Resources

Site Links


Question #1

Any character in an array can be accessed individually by using a method called superscript notation.

True         False


Question #2

The characters in an array are numbered, beginning with zero:

True         False


Question #3

Subscript notation makes for more readable code than the dereferencing operator.

True         False


Question #4

The compiler will not prevent you from going beyond the length of your array when accessing characters in an array individually

True         False


Question #5

When a character array is declared, the name given the array is actually a pointer variable.

True         False


Section 2 Question #1

Write your answer in the space following questions 6 through 10.
Write a statement that would assign the third element in the character array name to the character y


Section 2 Question #2

Given the character array declared as char Job[8] = "Plumber" ;
what character is returned by Job [4] ?


Section 2 Question #3

Given the character array declared as char Job[8] = "Plumber" ;what would be returned by the expression * (Job + 4)


Section 2 Question #4

Given the character array declared as char SSN[12] = "523-67-8941";, write a statement that will re-
place the character 6 with the character 1


Section 2 Question #5

Write a statement that will declare a character array named time and initially set its value to 5:00. Follow that statement with one that will change the contents of the character array to 5:01 by replacing only one character in the array.


Section 2 Question #6

Write a program that prompts the user for a string of text and stores it in a character array. The program should then store the first character of the string into a variable of type char named first-character and output the contents of first-character.

E-mail the completed program to frung@krhs.net with the subject Chap10 S2 N6