Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3.2, Problem 10STE
What would be the output in Self-Test Exercise 9 if the Boolean expression (x > 10) were changed to (x > 100)?
9. What output will be produced by the following code, when embedded in a complete
int x = 200;
cout << “Start\n”;
if (x < 100)
cout << “First Output. \n”;
else if (x > 10)
cout << “Second Output. \n”;
else
cout << “Third Output. \n”;
cout << “End\n”;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Language:java
Given the snippet of code:
int al = {2, 4, 6, 8, 10, 12), x, *p = a;
x = *(p + 4)+1;
printf("%d", x);
What will be the value of x after the following statement is executed?
13
5
12
11
4G I.
A elearning.ibrict.edu.om
Identify the correct condition for if to print
the value of the variable r?
int p,q,r;
p=11;
q=12;
r=8;
if ( ? )
{
printf("%d",q);
}
else
{
printf("%d",r);
}
O a. rr
С.
qr
II
Chapter 3 Solutions
Problem Solving with C++ (10th Edition)
Ch. 3.1 - Determine the value, true or false, of each of the...Ch. 3.1 - Name two kinds of statements in C++ that alter the...Ch. 3.1 - In college algebra we see numeric intervals given...Ch. 3.1 - Prob. 4STECh. 3.2 - What output will be produced by the following...Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - What would be the output in Self-Test Exercise 6...Ch. 3.2 - What would be the output in Self-Test Exercise 6...Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - What would be the output in Self-Test Exercise 9...
Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - Write a multiway if-else statement that classifies...Ch. 3.2 - Given the following declaration and output...Ch. 3.2 - Given the following declaration and output...Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - Prob. 19STECh. 3.2 - Though we urge you not to program using this...Ch. 3.3 - Prob. 21STECh. 3.3 - Prob. 22STECh. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - Prob. 25STECh. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - Prob. 27STECh. 3.3 - For each of the following situations, tell which...Ch. 3.3 - Rewrite the following loops as for loops. a.int i...Ch. 3.3 - What is the output of this loop? Identify the...Ch. 3.3 - What is the output of this loop? Comment on the...Ch. 3.3 - What is the output of this loop? Comment on the...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What does a break statement do? Where is it legal...Ch. 3.4 - Write a loop that will write the word Hello to the...Ch. 3.4 - Write a loop that will read in a list of even...Ch. 3.4 - Prob. 38STECh. 3.4 - Prob. 39STECh. 3.4 - What is an off-by-one loop error?Ch. 3.4 - You have a fence that is to be 100 meters long....Ch. 3 - Write a program to score the paper-rock-scissor...Ch. 3 - Write a program to compute the interest due, total...Ch. 3 - Write an astrology program. The user types in a...Ch. 3 - Horoscope Signs of the same Element are most...Ch. 3 - Write a program that finds and prints all of the...Ch. 3 - Buoyancy is the ability of an object to float....Ch. 3 - Write a program that finds the temperature that is...Ch. 3 - Write a program that computes the cost of a...Ch. 3 - (This Project requires that you know some basic...Ch. 3 - Write a program that accepts a year written as a...Ch. 3 - Write a program that scores a blackjack hand. In...Ch. 3 - Interest on a loan is paid on a declining balance,...Ch. 3 - The Fibonacci numbers F are defined as follows. F...Ch. 3 - The value ex can be approximated by the sum 1 + x...Ch. 3 - Prob. 8PPCh. 3 - Prob. 9PPCh. 3 - Repeat Programming Project 13 from Chapter 2 but...Ch. 3 - The keypad on your oven is used to enter the...Ch. 3 - The game of 23 is a two-player game that begins...Ch. 3 - Holy digits Batman! The Riddler is planning his...Ch. 3 - You have an augmented reality game in which you...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Why is the study of database technology important?
Database Concepts (8th Edition)
In what year was Plankalkl designed? In what year was that design published?
Concepts Of Programming Languages
In Exercises 55 through 60, find the value of the given function where a and b are numeric variables of type Do...
Introduction To Programming Using Visual Basic (11th Edition)
Body Mass Index Write a program that calculates and displays a persons body mass index (BMI). The BMI is often ...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Fill in the blanks in each of the following statements: A relation that has no partial functional dependencies ...
Modern Database Management
Assume a telephone signal travels through a cable at two-thirds the speed of light. How long does it take the s...
Electric Circuits. (11th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Complete the if-else statement to output "Below 90" if the value of userInput is below 90. Otherwise, output "90 or more". Ex: If the input is 88, then the output is: Below 90 1 import java.util.Scanner; 3 public class Relational { 345678 9 10 11 12 13 14 FREEdd public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userInput; 15 16 } 17 } userInput = scnr.nextInt (); if (* Your code goes here */) { System.out.println("Below 90"); } else { } System.out.println("90 or more");arrow_forwardplz solve it asap ????????: Write a program for a game that consists of two players. The rule of the game is that player 1 inputs a random number from 1-100. Player 2 will input 5 numbers. If the summation of those numbers is equal to the number OR less than or greater than the number by 3 (+3 or -3), then player 2 wins. Otherwise, player 1 wins. Test Case 1 Input Player 1, enter a number: 50 Player 2, enter a number: 10 Player 2, enter a number: 10 Player 2, enter a number: 20 Player 2, enter a number: 5 Player 2, enter a number: 7 Output Player 2 wins Explanation: The summation of 10,10,20,5 and 7 is 52 which is greater than 50 by 2. According to the rule, player 2 wins. Test Case 2 Input Player 1, enter a number: 50 Player 2, enter a number: 10 Player 2, enter a number: 10 Player 2, enter a number: 20 Player 2, enter a number: 5 Player 2, enter a number: 1 Output Player 1 wins Explanation: The summation of 10,10,20,5 and 1 is 46 which is less than 50 and also doesn’t…arrow_forwardjavaarrow_forward
- 4 Write an if-else statement to output "Exceeds capacity" if the value of roomCapacity is greater than 161. Otherwise, output "Does not exceed capacity". End with a newline. Ex: If the input is 163, then the output is: Exceeds capacity 1 import java.util.Scanner; 3 public class Relational { 4 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int roomCapacity; L23456789 5 11 10 11 12 } 13 } roomCapacity = scnr.nextInt (); /* Your code goes here */ 2arrow_forwardAn instructor wants to give feedback to students in an assignment according to the number of correctly solved programs. Example of feedback :Nb of correct programs Feedback 0 incomplete assignment1 partially correct assignment2 Satisfactory attempt 3 Good attempt4 Excellent attemptThe following figure shows an example of execution.Write the Java program that reads the number of correctly solved programs and displays the adequate feedback.Note: Choose your own feedback message and do not copy from the previous table. Use any of the conditional statements like if-else/ if-else-if/switch case.arrow_forwardx = int(input("Enter value for x:")) if x == -1 : print("Disagree") elif x == 0: print("Neutral") elif x == 1: print("Agree") else: print("Invalid entry") In the code above, suppose a programmer removed the Else part entirely. If x is 2, the code will not execute - True or False?arrow_forward
- /arrow_forwardQ/lf 2 = a, 7 = b, 2 = c, and 10 = d are integer variables, then the next print run is It (a>=b || a==c) a=b; if (a>c || (a+c)>d) d=c; if (darrow_forwardWrite TRUE if the output of the expression is true and FALSE if the output of the expression is false.arrow_forwardWrite a single statement that prints outside Temperature with 4 digits. End with newline. Sample output with input 103.45632: 103.5 Code writing challenge activity demo 468126.2649352.qx3zqy7 1 #include 2 #include 3 using namespace std; 4 5 6 7 8 9 int main() { 10 11 12 13} Run double outside Temperature; cin >> outside Temperature; /* Your solution goes here return 0; View your last submission ✓ 1 test passed All tests passedarrow_forwardjavaarrow_forwardava Program ASAP ************This program must work in hypergrade and pass all the test cases.********** Please look closely at the underlined parts of the correct test case. Fix the program below with the following modifications so it outputs the correct test case and nothing else: in Stopandsmelltheroses. the s needs to be Capital, a smaller case, s maller case r smaller case in the sentence and with spaces. The same applies to Atruerebelyouare!Everyone was impressed.You'lldowellto continue in the same spirit. Pleaseexplainabitmoreinthewayoffootnotes.Fromthegiventextit'snotclearwhatarewereadingabout. and Pleaseexplainabitmoreinthewayoffootnotes.Fromthegiventextit'snotclearwhatarewereadingabout. needs to be in another line and with spaces. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.regex.Pattern;import java.util.regex.Matcher;public class WordSeparator { public static void…arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY