course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

Experiment 2: Characters and Character Strings

One of the simple expressions in the output statement is '+' and another is " = ". In the first case, the plus symbol is surrounded by single-quotes and in the second case, the double-quotes surround a blank, an equal symbol and another blank. In C++, the '+' is called a character expression, while the " = " is called a character string expression.

A. In the space below, form a hypothesis that explains when characters should be surrounded with single-quotes (') and when they should be surrounded with double-quotes ("). Don't worry about your hypothesis being wrong -- if so, it's finding out why it is wrong that is important.





B. Next, in the space below, design an experiment to test your hypothesis. This part you should worry about -- if your hypothesis is wrong, then your experiment must tell you so.












C. Then carry out your experiment, and report its results in the space below:













D. If your hypothesis was shown to be incorrect, repeat steps A through C, until your hypothesis and experimental results agree. In the space below, explain why '+' is called a character expression and " = " is called a character string expression.







When you understand the difference between ' and " (in C++), continue to the next experiment.


 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Tuesday, August 22, 2000 at 11:16:34 AM.
visitors to this page.