(a)
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)
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)
To write a statement if number is positive, add number to variable positivesum; else, add the number to the variable nagtivesum.
(d)
To write a statement if the slope is less than 0.5, set the variable flag to 0; else, set flag to 1.
(e)
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)
To write a statement if frequency is above 60, print the message “The frequency is too high.”;
(g)
To write a statement if defferece between temp1 and temp2 exceeds 2.3, calculate the variable error as (temp1 − temp2) * factor.
(h)
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)
To write a statement if distance is greater than 35, request that the user input a value for the variable time.
Trending nowThis is a popular solution!
Chapter 4 Solutions
C++ for Engineers and Scientists
- I need the answer quicklyarrow_forwardQ1) How to use C code to write a C program segment to prompt a user for entering an integer and save it into an “option”variable. In your program, you have to make sure the value (option) entered by the user is either1, 2 or 3 only. Otherwise, display a message asking the user to re-enter the “option” value.[Note: Assume that all the necessary variables have been declared]arrow_forwardUsing C++ program 1. ( Use if-else statement ) Write a program for asking for a quiz score. The program then will display a remark if FAILED or PASSED. The passing score is 50. Display also the lacking score points. 2. Why does the following section of code always print "ByeHi" no matter what x is? int x; cin>> x; if x(x < 0); cout<< "Bye"; cout<< "Hi\n"; 3. Write the general form of an if-else statement.arrow_forward
- Python (Do following way) # We same a name is short if it is 3 characters or fewer. Ask the user for# their name with the prompt 'Enter your name: '# If the len() of the user' name is less than 4, print the user's name,# followed by 'is a short name'# Otherwise, print the user's name, followed by 'is not a short name' # DO NOT USE TWO IF STATEMENTS. Use an if + else. If you use two if statements# I will deduct points even if your code passes the tests. # For example:# Enter your name: PB# pb is a short name # Another example:# Enter your name: Lamio# Lamio is not a short namearrow_forwardа. (1 =5) d. a, b, and c are all wrong 4) Which of the following is not a valid boolean expression.arrow_forward(c programming) Write a program using switch to input a letter (L) and and number of cars(C). The program will do the following according the value of L and displays it as shown belowarrow_forward
- {Only using C language} ( Code C) Rules programs: You have to solve using 1.if else / switch 2. while / for Please, quickly, I have a specific time to answer The program shall be solved either by using if else ladder or switch only. No marks will be awarded if the problem is solved using any other technique. Problem: Read your name and one numeric value [Omani Rial], print the following menu as shown in below output, read user choice. Find and print equivalent currency value. Formulas: 1 Omani Rial = 2.60 US Dollars 1 Omani Rial = 2.18 Euros 1 Omani Rial = 1.86 British pounds 1 Omani Rial = 9.55 UAE Dirhamsarrow_forward(PYTHON) 3. Create an if statement that checks to see if the number x is greater than 0 and less than or equal to 50.arrow_forward1.) Create a c++ divisibility test program. The program will ask for an integer value then the system will evaluate if the integer value is divisible by 3 or not, if it’s divisible by 3 is it also divisible by 9.arrow_forward
- State whether the following are true or false. If the answer is false, explain why.c) The expression (x > y && a < b) is true if either x > y is true or a < b is true.arrow_forwardi need the answer quicklyarrow_forward.c program The Problem Statement You and your roommates go through a lot of orange juice. Since you're living on a college budget, you've decided that it's critical for you to take advantage of the "Buy One Get One" (BOGO) free offers at the nearby grocery store. Program Setup Your C program should ask the user to enter the price of one carton of juice as well as the number of cartons being purchased. Note that since juice is an ordinary grocery item, no sales tax is charged on it. Then, determine the final cost of buying orange juice under the BOGO offer. While it is possible to make a solution that does not use If Statements, the purpose of the assignment is to practice with conditions. Make sure you take this opportunity to get the practice you need to master the programming concepts. You'll need to account for two different cases: buying an even number of OJ cartons and buying an odd number of OJ cartons. How can you determine if a number is even or odd? A number that is…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning