Question: Using C++. Short Answer Questions: Given two floating point variables x and y. Write a single input statement to read the values of both x

Using C++.

  1. Short Answer Questions:
  1. Given two floating point variables x and y. Write a single input statement to read the values of both x and y (must put a prompt before the input statement)
  2. Write a selection statement that will check the state of water depending on its temperature. If the temperature is greater than or equal to 212, display vapor state, otherwise check if it is less than 212, but greater than 32, then display liquid, and if less than or equal to 32, then display solid
  3. Given a string variable str1, and assume its value is defined. Write proper C++ statements to display the length of the string str1 and also display a substring that starts from second character and has total 4 characters.
  4. Write a for loop that can be used to first ten odd numbers.
  5. Factorial of an integer number n can be approximated using the following formula

factorial = , where e = exp(1)

Write this expression properly in C++ (not the entire program).

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!