Question: USING C++ Here is what I have to do: Read some text into a vector, storing each word in the input as an element in

USING C++

Here is what I have to do: Read some text into a vector, storing each word in the input as an element in the vector. Transform each word into uppercase letters. Print the transformed elements from the vector, printing eight words to a line.

Here is what I have so far. But I cannot get the program to take in over 10 elements and keep only 8 on the same line. Right now it is only showing one word on an individual line. Please help! This is my billionth time posting this question and not one answer has helped me.

#include  #include  #include  #include  #include  using std::cin; using std::cout; using std::endl; using std::istringstream; using std::string; using std::vector; using namespace std; int main() { string s; vectorv; cout << "Please enter amount needed for string: "; int amount; cin >> amount; while (true) { cin >> s; if (s == "DONE") break; v.push_back(s); } for(int i = 0; i < v.size(); ++i) { for(int j = 0; j < v[i].size(); ++j) { if(islower(v[i][j])) { v[i][j] = toupper(v[i][j]); } } } for(int i = 0; i < v.size(); ++i) { cout << v[i] << " "; } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!