Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions