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# (4th Edition)
Additional Engineering Textbook Solutions
Modern Database Management
Web Development and Design Foundations with HTML5 (8th Edition)
Concepts of Programming Languages (11th Edition)
Database Concepts (7th Edition)
Computer Science: An Overview (12th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
- GPA Calculator Students are concerned about their GPA. They need to calculate it accurately every semester to monitor their progress. Develop a GPA calculator that follows the AOU regulations (AOU-OU Grade Scale) using C# programming language. The application asks the student to enter his numeric grade of each course and the course's credit hours. Accordingly, the application calculates the student's GPA after converting the numeric grade to letter grade. The GPA calculation should produce floating-point results. Display the results rounded to the nearest hundredth. You should store the letter grades of all student's courses in an array. The final grade of the student should be also calculated. Sample I/O Enter the course grade (-1 to end): 93 Enter the course credit hours: 3 Enter the course grade (-1 to end): 74 Enter the course credit hours: 2 Enter the course grade (-1 to end): 60 Enter the course credit hours: 3 Enter the course grade (-1 to end): -1 The grades of your courses…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
- Most C++ statements end with a(n)________.arrow_forwardT F Variable names may begin with a number.arrow_forwardC++ 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_forward
- When 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_forwardTrue or False 6. In languages that require variable declarations, a variable’s declaration must appear before any other statements that use the variable.arrow_forward
- Restaurant: Point-of-Sales System Create a software application that can be used for a Restaurant using C language. The expected minimum functionality are as follows: Menu Display It must display at least 10 choices with their corresponding prices On your menu, at least one of the categories/choice should have customization/add-on. You should have at least 3 customization/add-on (e.g. In Starbucks, you can have extra espresso shot). Taking Orders As a customer, I want to select which of the choices I want to order As a customer, everytime I specify select my choice, I want to specify the quantity of my selected choice. After I finished my order, it should ask, "Anything Else?". Afterwards, as a customer, I should be to enter my succeeding choice. In order to stop taking order, the exit should be part of the menu. As a customer, I would only select that choice to exit If the customer selects a choice qualified for customization, after specifying the quantity, I should be asked,…arrow_forwardDevelop a C# application that allows the user to calculate the fat of his daily food. The user should enter: • The total number of calories for a food item • The number of fat grams in that food item Accordingly, the application will calculate and display: • The number of calories from fat • The percentage of calories that come from fat Additionally, the applications categorizes if the food is considered low fat, normal fat, or high fat as the following rule. • If the calories from fat are less than 30% of the total calories of the food, the food is considered low fat. • If the calories from fat are between 30% and 40% of the total calories of the food, the food is considered normal fat. • If the calories from fat are more than 40% of the total calories of the food, the food is considered high fat. Note: Make sure the number of calories and fat grams are not less than 0. Also, the number of calories from fat cannot be greater than the total number of calories. If that happens, display…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