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
Achieved Level 70
32,137 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,576
Skill Endorsements: 69
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
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
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
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
Question Answered as of 1 Year Ago by
zeroliken
and
Ancient Dragon Thanks a lot! That fixed it. :)
Good to hear... have fun programming :)
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14