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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started