Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a void function called OnlyUppercase IN C++ that has only two parameters, a reference to a istringstream and a reference to an ostring stream.

Write a void function called "OnlyUppercase" IN C++ that has only two parameters, a reference to a istringstream and a reference to an ostring stream. This function should read whitespace separated words from the first argument and write those words (each with a trailing newline character) to the second argument. However, only the words that are composed solely of UPPERCASE letters should be written to the second argument

Example input and output:

.image text in transcribed

INPUT OF THE TEST CASE #include but NOT! This"); std::istringstream iss("WORD AND ANOTHER std::ostringstream oss; OnlyUppercase (iss, oss); ASSERT_EQ(oss.str(), "WORD AND ANOTHER "); - 0 std::istringstream iss_2(" Many Words THAT ONLY SOME SHOULD Be -ADDED"); std::ostringstream oss_2; OnlyUppercase (iss_2, oss_2); ASSERT_EQ (oss_2.str(), "THAT SHOULD "); 10 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions