Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (624.34 KB, 10 trang )
<span class='text_page_counter'>(1)</span><div class='page_container' data-page=1></div>
<span class='text_page_counter'>(2)</span><div class='page_container' data-page=2>
There is no real
There is no real
answer to the question,
answer to the question,
but we’ll call it a
but we’ll call it a
“thinking cap”.
“thinking cap”.
The plan is to describe
The plan is to describe
a thinking cap by
a thinking cap by
telling you what
telling you what
actions can be done to
actions can be done to
it.
You may put a piece of
You may put a piece of
paper in each of the two
paper in each of the two
slots (green and red), with a
slots (green and red), with a
sentence written on each.
sentence written on each.
You may push the green
You may push the green
button and the thinking cap
button and the thinking cap
will speak the sentence
will speak the sentence
from the green slot’s paper.
from the green slot’s paper.
And same for the red
And same for the red
button.
We can implement the
We can implement the
thinking cap using a
thinking cap using a
data type called a
data type called a
class
class.<sub>.</sub>
class thinking_cap
{
green_string and <sub> and </sub>
red_string
red_string. These . These
The two components
The two components
will be
will be private private
member variables
In a class, the
In a class, the
functions which
functions which
manipulate the class
manipulate the class
are also listed.
are also listed.
class thinking_cap
{
public:
. . .
private:
char green_string[50];
Prototypes for the
thinking cap
functions go here,
after the word