Applications 03
Applications 03
Q2. Write a C++ program that determines whether a given temperature is less than or greater
than the room temperature (25°C ). If it is exaclty equal to the room temperature, the program
displays “the temperature is good!”. If it is less than rooom temperature, the program displays
“increase the temperature”. If it is greater, the program displays “decrease the temperature”.
Q3. Write the C++ program required to calculate y(t) from the equation
− 4t 3 + 3 t ≤ 0
y(t)= 4t 3 + 3 0 < t < 2
17.5t t ≥ 2
Q4. In a mechanical engineering department, a student must enroll for three elective courses
during the last term. The student must select three courses from following list of options:
Construct a C++ p rogram that prompts the student for his or her choice, read in the choice,
and use the answer as the case expression for a switch construct. Be sure to include a default
case to handle invalid inputs.
Q5. Write a program to read one of the codes “C” for circle, “S” for square, or “T” for a
triangle, and a number representing the radius of the circle, the side of the square, or the sides
of the triangle, respectively. Then calculate and display the area and the perimeter of that
geometric figure with appropriate labels.
Q6. Write a C++ program required to calculate y(α) from the equation
Tan(α ) α ≠ π , 3π
2 2
y(α)=
Undefined α = π , 3π
2 2
01 LCD 1050
02 Radio 55
03 VCD 150
04 Telephone 75
05 Fax 150
06 Harddisk 130
Write a C++ program to learn the product name and its price when the product code is
entered.
Q8. Write a C++ program that determines whether a given number is divisible by 15 or not.
Q9. Write a program to order three arbitrary numbers that are input from keyboard. Use an
increasing order.