STARTING OUT W/PROGRAM.LOGIC...-TEXT
5th Edition
ISBN: 2810022369454
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 4.2, Problem 4.8CP
Program Plan Intro
Decision structure:
Decision structure executes a set of statements under certain conditions. It is also known as selection structure. The action is performed only when the condition exists and takes different actions depending upon the state “True” or “False”. The two categories of decision structure are given as follows:
- Single alternative decision structure
- Dual alternative decision structure
Single alternative decision structure:
This gives only alternative path of execution. A “if” statement is used to write a single alternative decision structure.
- If the condition is “true”, it executes the statement inside the block.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
What are the differences between decision structures and sequence structures?
Question Completion Status
O and
QUESTION 13
Compare and contract two-way decision structures with mutiway decision structures how are they similar and how are they different
For the toolbar, press ALT-F1O (PC) or ALT+FN+F10 IMac).
After learning the looping and input validation concepts, create a problem to give to your students to allow them to practice the looping and input validation concepts. The problem should include at least two different decision structures and a loop. The number of times to process the loop is stated in the problem definition. The decision structures should be chosen from the simple, combined, nested and CASE structures.
The problem description should include:
The input into the problem.
The output from the problem.
The generic processing necessary to solve the problem. (do not give too much information away).
The solution should include:
Input validation statements
The solution should include the exact calculations need to solve the problem
Chapter 4 Solutions
STARTING OUT W/PROGRAM.LOGIC...-TEXT
Ch. 4.1 - What is a control structure?Ch. 4.1 - What is a decision structure?Ch. 4.1 - Prob. 4.3CPCh. 4.1 - Prob. 4.4CPCh. 4.1 - What types of relationships between values can you...Ch. 4.1 - Write a pseudocode If-Then statement that assigns...Ch. 4.1 - Write a pseudocode If-Then statement that assigns...Ch. 4.2 - Prob. 4.8CPCh. 4.2 - What statement do you use in pseudocode to write a...Ch. 4.2 - When you write an If-Then-Else statement, under...
Ch. 4.3 - If the following pseudocode were an actual...Ch. 4.3 - If the following pseudocode were an actual...Ch. 4.4 - Prob. 4.13CPCh. 4.4 - What statement do you use in pseudocode to write a...Ch. 4.4 - When you write an If-Then-Else statement, under...Ch. 4.4 - Convert the following pseudocode to an...Ch. 4.5 - Prob. 4.17CPCh. 4.5 - How do you write a multiple alternative decision...Ch. 4.5 - What does the case structure test, in order to...Ch. 4.5 - You need to write a multiple alternative decision...Ch. 4.6 - Prob. 4.21CPCh. 4.6 - Prob. 4.22CPCh. 4.6 - Assume the variables a = 2, b = 4, and c = 6....Ch. 4.6 - Explain how short-circuit evaluation works with...Ch. 4.6 - Prob. 4.25CPCh. 4.6 - Write an If-Then statement that displays the...Ch. 4.7 - Prob. 4.27CPCh. 4.7 - What is a flag variable?Ch. 4 - A __ structure can execute a set of statements...Ch. 4 - A __ structure provides one alternative path of...Ch. 4 - In pseudocode, the If-Then statement is an example...Ch. 4 - A(n) __ expression has a value of either true or...Ch. 4 - The symbols,, and== are all __ operators. a....Ch. 4 - A(n) __ structure tests a condition and then takes...Ch. 4 - You use a(n) __ statement in pseudocode to write a...Ch. 4 - You use a(n) _________ statement in pseudocode to...Ch. 4 - A ______ structure allows you to test the value of...Ch. 4 - Prob. 10MCCh. 4 - AND, OR, and NOT are _____ operators. a....Ch. 4 - A compound Boolean expression created with the...Ch. 4 - A compound Boolean expression created with the...Ch. 4 - The ____ operator takes a Boolean expression as...Ch. 4 - A ________ is a Boolean variable that signals when...Ch. 4 - Prob. 1TFCh. 4 - A program can be made of only one type of control...Ch. 4 - A single alternative decision structure tests a...Ch. 4 - A decision structure can be nested inside another...Ch. 4 - A compound Boolean expression created with the AND...Ch. 4 - Explain what is meant by the term conditionally...Ch. 4 - You need to test a condition and then execute one...Ch. 4 - If you need to test the value of a variable and...Ch. 4 - Briefly describe how the AND operator works.Ch. 4 - Briefly describe how the OR operator works.Ch. 4 - Prob. 6SACh. 4 - What is a flag and how does it work?Ch. 4 - Design an If-Then statement (or a flowchart with a...Ch. 4 - Design an If- Then statement (or a flowchart with...Ch. 4 - Design an If- Then-Else statement (or a flowchart...Ch. 4 - The following pseudocode contains several nested...Ch. 4 - Design nested decision structures that perform the...Ch. 4 - Rewrite the following If-Then-Else If statement as...Ch. 4 - Design an If-Then-Else statement (or a flowchart...Ch. 4 - Design an If-Then-Else statement (or a flowchart...Ch. 4 - Design a case structure that tests the month...Ch. 4 - Write an If-Then statement that sets the variable...Ch. 4 - Part of the following pseudocode is incompatible...Ch. 4 - Prob. 2DECh. 4 - Prob. 3DECh. 4 - Roman Numerals Design a program that prompts the...Ch. 4 - Areas of Rectangles The area of a rectangle is the...Ch. 4 - Mass and Weight Scientists measure an objects mass...Ch. 4 - Magic Dates The date June 10, 1960, is special...Ch. 4 - Color Mixer The colors red, blue, and yellow are...Ch. 4 - Book Club Points Serendipity Booksellers has a...Ch. 4 - Software Sales A software company sells a package...Ch. 4 - Change for a Dollar Game Design a change-counting...Ch. 4 - Shipping Charges The Fast Freight Shipping Company...Ch. 4 - Body Mass Index Program Enhancement In Programming...Ch. 4 - Time Calculator Design a program that asks the...Ch. 4 - Leap Year Detector Design a program that asks the...
Knowledge Booster
Similar questions
- SCENARIO-BASED PROBLEM:Omantel wants to adopt a new system for their billing system. You are requested to lead a programming team that will develop a system form them.The program will start by entering the number of subscriptions. The number of subscriptions will be used as basis for the number of times the subscription type, the number of units and the amount of mobile data will be entered by the user. (Example: If user entered 5 for the number of subscriptions, the subscription type, number of units and the amount of mobile data will be entered also five times).The subscription fee is computed based on the subscription type and the amount of mobile data.arrow_forwardQUESTION 1 Implement the decision structure in the following: Print "spring" if a is equal to b, print "fall" if a is greater than b, otherwise print "break". Use the variables given below: a = 24.0 || b = 24arrow_forwardAnswer the 2 subparts. You are obligated to answer 3 subpartsarrow_forward
- Question Completion Status: A Click Submit to complete this assessment. Quèstion 16 In modular exponentiation algorithm if a =1 then x:= (x.power) mod m (x.power) mod n (n.power) mod m (x.n.power) mod marrow_forwardComputational Theory: The halting problem is described as the impossibility to know if a program (based on any programming language) will halt or not after it starts running. How would you simulate or semi-simulate the halting problem? If a simulation is possible, provide a graph or a flow chart. Explain your reasoning. If a simulation is not possible, explain your reasoningarrow_forwardWhich design heuristics work best?arrow_forward
- Kevin is going to use a Boolean operator because he wants to learn about two different things. Kevin needs to pick the right Boolean function to get the right search results.arrow_forwardA rule-based classifier is built through indirect method from a decision tree. The decision tree turns out to be overfit on training data. What will be the impact on rule-based classifier?arrow_forwardComputer Progarrow_forward
- Describe the use of conditional operators (e.g., ternary operators) in programming, and provide a scenario where they are particularly useful.arrow_forwardwhat is Dual-alternative selection structures ?arrow_forwardThis decision tree structure has three options. You believe in gathering data and making decisions.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT