Question: C++ 1.) Write a function that is given a phrase and returns the first word in that phrase. For example, given the quick brown fox,
C++
1.) Write a function that is given a phrase and returns the first word in that phrase. For example, given the quick brown fox, your function should return the.
Here is an example call to the function
cout << firstword(the quick brown fox);
Function Signature
string firstword(string s):
Note: You do not need to submit any other code including the main method or any print statements. ONLY the firstword function is required (leave in your includes and namespace directives). The above example should be used to test your code but deleted or commented out upon submission.
_______________________________________________________________________________________________________________________________
C++
2.) Write a function that is given a phrase and returns the phrase we get if we take out the first word from the input phrase. For example, given the quick brown fox, your function should return quick brown fox
Here is an example call to the function
Cout << remainingwords(the quick brown fox);
Function Signature
string remainingwords(string s);
Note: You do not need to submit any other code including the main method or any print statements. ONLY the remainingwords function is required(leave in your includes and namespace directives). The above example should be used to test your code but deleted or commented out upon submission.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
