Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions