Concept explainers
A __________ structure executes a set of statements only under certain circumstances.
- a. sequence
- b. circumstantial
- c. decision
- d. Boolean
The structure which executes statements under certain conditions is called as a decision structure.
Hence, the correct answer is option “C”.
Explanation of Solution
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 action depending upon the state “True” or “False”.
Example for decision structure:
“if” statement:
“if” statement is used to make a decision structure, which permits the program to hold more than one path of execution.
- The indented statement is executed only when the condition is “true”.
- If the given condition is “false”, it skips the indented statements.
Syntax for “if” statement:
if condition:
indented_statement_block
Explanation for incorrect options:
Sequence:
Simplest form of control structure is the sequence structure. It is a group of statements that are executed in the order in which they appear.
Hence, the option “A” is wrong.
Circumstantial:
Circumstantial structure does not execute the statements under certain conditions.
Hence, the option “B” is wrong.
Boolean:
The Boolean expression evaluates the statement as either “True” or “False” with the help of “if” statement.
Hence, the option “D” is wrong.
Want to see more full solutions like this?
Chapter 4 Solutions
Starting Out With Visual C# (5th Edition)
Additional Engineering Textbook Solutions
Degarmo's Materials And Processes In Manufacturing
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Electric Circuits. (11th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Database Concepts (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
- The Structure statement is usually entered in the form’s__________ section in the Code Editor window.arrow_forward*program must be made in C# using visual studio* You will be creating a program that will allow the user to enter information about a home rental. The program should allow them to enter the name of the rental, the number of months the rental will be used, the cost per a single month and the total budget allowed to rent. There should be a button that will then calculate the total cost of the rental, as well as output the name, number of months, individual cost and total cost of the rental each in their own label. In addition, there should be a label that lets the user know if the rental would be over or under the budget entered. The number of months will need to be entered as a number between 0 and 13. If they enter a number outside of that range, when the calculation button is clicked a label should show up letting the user know the number of months entered was not in the correct range. A similar check should be performed for the individual cost and budget, one that ensures a number…arrow_forwardA __________ structure executes a set of statements only under certain circumstances.a. sequenceb. circumstantialc. decisiond. Booleanarrow_forward
- C++ Visual 2019 Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase: The number of shares that Joe purchased was 1,000. When Joe purchased the stock, he paid $45.50 per share. Joe paid his stockbroker a commission that amounted to 2 percent of the amount he paid for the stock. Two weeks later, Joe sold the stock. Here are the details of the sale: The number of shres that Joe sold was 1,000. He sold the stock for $56.90 per share. He paid the stockbroker another commission that amounted to 2 percent of the amount he received for the stock. Write a program that displays the following information: The amount of money Joe paid for the stock. The amount of commission Joe paid his broker when he bought the stock. The amount that Joe sold the stock for. The amount of commission Joe paid his broker when he sold the stock. Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the…arrow_forwardWhen using parameterized manipulators, the header_________ must be included.arrow_forwardI.4. Usually a _________ indicates to a program the end of a data structure. a) backslash characterb) forward slash characterc) null referenced) null pointerarrow_forward
- True or False 6. In languages that require variable declarations, a variable’s declaration must appear before any other statements that use the variable.arrow_forwardLad ℗ Ⓒ Understanding Nested if Statements Summary In this lab, you complete a prewritten Java program that calculates an employee's productivity bonus and prints the employee's name and bonus. Bonuses are calculated based on an employee's productivity score as shown below. A productivity score is calculated by first dividing an employee's transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked. Instructions Productivity Score Bonus <30 31-69 70-199 ≥ 200 1. Ensure the file named EmployeeBonus.java is open. 2. Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step. $50 $75 $100 $200 3. Design the logic, and write the rest of the program using a nested if statement. 4. Execute the program by clicking Run and enter the following as input: Employee's first name: Kim Smith Number of shifts: 25 Number of transactions: 75…arrow_forwardMail Delivery Service Create a Python application, Delivery.py for a delivery service. The program should prompt the user for the following inputs. A code representing the delivery area. A local delivery is code 1, and a long distance delivery is code 2. A weight, in pounds of the item to be delivered. The program will then display the fee for the item based on the delivery type and its weight. The fee for the delivery, as follows: 1. Distance Fee (S) Weight Under 5 pounds 5 to 20 pounds Over 20 pounds Under 5 pounds 5 pounds or more 1 12.00 1 16.50 1 22.00 2 35.00 2 47.95 For examples: (These outputs are from different runs. They are not from a loop.) Delivery Service Enter Distance (1) Local - (2) Long Distance: Enter weight: 4.9 ------ Summary Delivery Type: Local Weight: 4.9 pounds Fee: $12.00 Delivery Service Enter Distance (1) Local - (2) Long Distance: Enter weight: 4.9 --------- Summary Delivery Type: Long Distance Weight: 4.9 pounds Fee: $35.00 Delivery Service Enter Distance…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning