>
LGgIC
Greater than - Case dependent compaflsion, numbers compared
In
numerical
order.
<
Less
than - Case dependent, numbers compared
in
numerical order
= Equals - Case dependent, stflngs must
be
the
same
--
Equivalent - String must be
'almost"
the
same,
Case independent, numbers
compared
in
numerical
order.
>= Greater
than
or equal
to
- Case dependent, numbers compared
in
numerical
order
<=
Less
than
or
equal
to
- Case dependent, numbers compared
in
numerical
order.
•
1.
62
PROBLEMS
ON
CHAPTER
11
Place
12
letters,
all
different,
in
a string variable and another
SIX
letters
in
a second
string variable. Search the
first
string for each
of
the
six
letters
in
turn saying
in
each case whether
it
is
found or not found.
2.
Repeat using single character
arrays
instead
of
strings.
Place twenty random upper
case letters
in
a string and
list
those which
are
repeated. •
3.
Write
a program to
read
a sample
of
text
all
in
upper case
letters.
Count the
frequency of each letter and print the
results.
"GOVERNMENT IS A TRUST, AND THE OFFICERS
OF
THE
GOVERNMENT ARE TRUSTEES; AND
BOfH
THE TRUST AND THE
TRUSTEES ARE CREATED FOR THE BENEFIT OF THE PEOPLE. -
HENRY
CLAY,
1829."
4.
Write
a program to count the number
of
words
in
the following
text.
A word
is
recognised because
it
starts
with a letter and
is
followed by a space,
full
stop or
other punctuation character.
"THE REPORTS OF MY
DEATH
ARE
GREATLY
EXAGGERATED. -
CABLE FROM MARK TWAIN
10
THE ASSOCIATED PRESS, LONDON
1896:'
5.
Rewrite the last program illustrating the
use
of
logical variables and procedures.
•
•
12/84