The first function is incorrect
void print (string word)
{
cout << word << '\n'; // display the string
}
Now do similar for second function, but this time put cout statement inside a loop.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
The second function should take a string and an integer as arguments, and print out the string as many times as the integer.
what exactly did you put in that function? Did you use a loop?
void print (string word, int number)
{
/*create loop that will print the following string as many times as the integer passed*/
cout << word << endl; // display the string
}
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
at line 32
try it like this
cin >> word; //receive input for word
cin >> number; //receive input for number
or simply
cin >> word >> number;
then at line 33 call the function print (word, number);
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
Thanks a lot! That fixed it. :)
Good to hear... have fun programming :)
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162