C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 4.2, Problem 1E

(a)

Program Plan Intro

To write a statement if an angle is equal to 90 degree, print the message “The angle is a right angle”; else, print the message “The angle is not a right angle.”.

(b)

Program Plan Intro

To write a statement if temperature is above 100 degrees, display the message “above the boiling point of water”; else, display the message “below the boiling point of water.”.

(c)

Program Plan Intro

To write a statement if number is positive, add number to variable positivesum; else, add the number to the variable nagtivesum.

(d)

Program Plan Intro

To write a statement if the slope is less than 0.5, set the variable flag to 0; else, set flag to 1.

(e)

Program Plan Intro

To write a statement if the difference between volts1 and volts2 is less than 0.001, set the variable approx to 0; else, calculate approx. as quantitity (volts1 − volts2) / 2.0.

(f)

Program Plan Intro

To write a statement if frequency is above 60, print the message “The frequency is too high.”;

(g)

Program Plan Intro

To write a statement if defferece between temp1 and temp2 exceeds 2.3, calculate the variable error as (temp1 − temp2) * factor.

(h)

Program Plan Intro

To write a statement if x is greater than y and z is less than 20, request that the user to input a value for the variable p.

(i)

Program Plan Intro

To write a statement if distance is greater than 35, request that the user input a value for the variable time.

Blurred answer
Students have asked these similar questions
(C PROGRAMMING ONLY) 1. Leap Year Detectorby CodeChum Admin Let’s try to find out whether a year has 365 or 366 days. To do this, we need to create a leap year detector!   Conditions for a leap year: 1.) year must be divisible by 4 and not divisible by 100 2.) If year is divisible by 100, it must be divisible by 400 for it to be a leap year.   Instructions: You are provided with the isLeapYear() function which is already declared and defined for you.Your task is to ask the user for a year and then call the isLeapYear function to check whether the year is a leap year or not.Input 1. Year to be checked Output If a certain year is a leap year, print "<INSERT_YEAR_HERE> is a leap year"Otherwise, print "<INSERT_YEAR_HERE> is not a leap year" Enter year: 20202020 is a leap year
Problem Definition The Gaussian distribution is given by: Where μ, is the mean, sd, is the standard deviation, and t, is the variable of the function; e is the exponential function and = 3.1415 (Note: pi constant) f(t)=¹_e-² (²-4)³² o√2π Write a C++ program that asks the user to enter the values of μ, s, and t; then calculates and prints the value of f(t). Use the C++ function 'exp' to compute the exponential of .x (e). Your program should: a) Use appropriate variable names, and meaningful comments to describe the algorithm. b) Use appropriate messages and a suitable format to display the result (see Figure 1) c) Display the floating-point numbers up to 3 decimal places. GAN C:\WINDOWS\system32\cmd.exe Enter mean: 1.4 Enter standard deviation (sd) Enter time: 0.95 f(t) -0.030 Press any key to continue. : 0.15 Figure.1: Sample output Deliverable: 1) Name your program file including HW1_SEC**_*****.cpp where ** and ***** are your SECTION and student ID number respectively. For example a…
1.(Multiple Choice) Which of the following is achieved by testing the following conditionalstatement with inputs (i=True, j=True) and (i=True, j=False):if i:If j:print(“yay”)else:print(“nay”)a. 100% decision coverageb. 100% statement coveragec. 100% condition coveraged. 100% modified condition/decision coverage
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr