Modify
Hello.cpp
so that it prints out your name and age (or shoe size, or your dog’s age,
if that makes you feel better). Compile and run the program.
Starting
with
Stream2.cpp
and
Numconv.cpp,
create a program that asks for the radius of a circle and prints the area of
that circle. You can just use the ‘
*’
operator to square the radius.
Create
a program that opens a file and counts the whitespace-separated words in that
file.
Create
a program that counts the occurrence of a particular word in a file (use the
string
class’ operator ‘
==’
to find the word).
Modify
FillString.cpp
so that it adds line numbers to each of the input lines as they are added to
s.
Change
Fillvector.cpp
so it prints the lines (backwards) from last to first.
Change
Fillvector.cpp
so it concatenates all the elements in the
vector
into a single string before printing it out, but don’t try to add line
numbering.
Display
a file a line at a time, waiting for the user to press the “Enter”
key after each line.
Create
a
vector<float>
and put 25 floating-point numbers into it using a
for
loop. Display the
vector.
Create
three
vector<float>
objects and fill the first two as in the previous exercise. Write a
for
loop that adds each corresponding element in the first two
vectors
and puts the result in the corresponding element of the third
vector.
Display all three
vectors.
Create
a
vector<float>
and put 25 numbers into it as in the previous exercises. Now square each number
and put the result back into the same location in the
vector.
Display the
vector
before and after the multiplication.