Question: HERE IS THE QUESTION BELOW THAT YOU SHOULD USE C++ AND SHOW ALL THE OUTPUTS: ----------------------------------------------------------------------------------------------------------------------------------------------------- Write a program that prompts the user to enter

HERE IS THE QUESTION BELOW THAT YOU SHOULD USE C++ AND SHOW ALL THE OUTPUTS:

-----------------------------------------------------------------------------------------------------------------------------------------------------

Write a program that prompts the user to enter an int, a double, and a string on the command line. Read the values into variables of the appropriate data type with std::cin. Write the 3 values to std::cout. This program does not require the use of CppUnitLite.

Write CppUnitLite tests which verifies std::stringstream. These test will follow the pattern shown in the lesson 1 discussion Use stringstream instead of atoi and sprintf. Write separate tests to:

read and write a double

read and write a float

read and write a string

Initialize a stringstream with the "Hello". Attempt to stream this value into an int variable. Write a check that verifies this fails.

Be sure to use CHECK_DOUBLES_EQUAL for float types and CHECK_EQUAL for other types.

Write a CppUnitLite test that uses new to allocate an array of 10 integers. Initialize the array with the values 0 to 9. Use CHECK_EQUAL to verify the array has the correct values. Use delete to deallocate the array.

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!