Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 4, Problem 3DE
Program Plan Intro
Syntax error:
An error which occurs on the source code of a
Compilation error:
It is an error which occurs when a compiler fails to compile the program due to some errors. This type of error helps the coder to debug the program code for some possible errors.
Logical error:
Logical error prevents the program from performing, because of the errors in the logical statements.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Read the following scenario, then answer the question that follows:
“An application requires a user to enter two numbers. Once the user has entered the two numbers, the application will call a module to calculate the average of the two numbers. Once the average of the two numbers have been calculated, another module will be called to determine if the average of the two numbers is greater than 75. If the average of the two numbers is greater than 75, the message ‘Congratulations, you are in the top 5’, will be displayed.”
Create a flowchart for each module that will be called. The flowcharts should adequately represent the logic in the scenario provided.
Read the following scenario, then answer the question that follows:
“An application requires a user to enter two numbers. Once the user has entered the two numbers, the application will call a module to calculate the average of the two numbers. Once the average of the two numbers have been calculated, another module will be called to determine if the average of the two numbers is greater than 75. If the average of the two numbers is greater than 75, the message ‘Congratulations, you are in the top 5’, will be displayed.”
By using examples differentiate between a single‐alternative and a dual‐alternative if statement.
Read the following scenario, then answer the question that follows:
“An application requires a user to enter two numbers. Once the user has entered the two numbers, the application will call a module to calculate the average of the two numbers. Once the average of the two numbers have been calculated, another module will be called to determine if the average of the two numbers is greater than 75. If the average of the two numbers is greater than 75, the message ‘Congratulations, you are in the top 5’, will be displayed.”
Q.3.1
Create a flowchart for each module that will be called. The flowcharts should adequately represent the logic in the scenario provided.
Q.2.3
Identify the three basic structures used in a program. Also indicate which one do you prefer over others and motivate why.
Q.2.4
By using examples differentiate between a single‐alternative and a dual‐alternative if statemen
Chapter 4 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
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
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
- Read the following scenario, then answer the question that follows: “An application requires a user to enter two numbers. Once the user has entered the two numbers, the application will call a module to calculate the average of the two numbers. Once the average of the two numbers have been calculated, another module will be called to determine if the average of the two numbers is greater than 75. If the average of the two numbers is greater than 75, the message ‘Congratulations, you are in the top 5’, will be displayed.” Identify the three basic structures used in a program. Also indicate which one do you prefer over others and motivate why.arrow_forwardRead the following scenario, then answer the question that follows:“An application requires a user to enter two numbers. Once the user has entered the two numbers, the application will call a module to calculate the average of the two numbers. Once the average of the two numbers have been calculated, another module will be called to determine if the average of the two numbers is greater than 75. If the average of the two numbers is greater than 75, the message ‘Congratulations, you are in the top 5’, will be displayed.”Q.3.1 Create a flowchart for each module that will be called. The flowcharts should adequately represent the logic in the scenario provided.arrow_forward#3 – This pseudocode has multiple problems. Fix the calling statement and the definition below so that the routine accepts 3 grades as parameters and returns the average into a variable. Call calcPercentageof(Boolean Number) Module calcPercentageOf (numerator, num2) Set percentage = num / num2 * 100 End Module Write the correct call statement and module definition below:.arrow_forward
- Find the error in the following pseudocode: Module main() Declare Real mileage Call getMileage() Display "You've driven a total of ", mileage, " miles." End Module Module getMileage() Display "Enter your vehicle’s mileage." Input mileage End Modulearrow_forwardRead the following scenario, then answer the question that follows:“An application requires a user to enter two numbers. Once the user has entered the twonumbers, the application will call a module to calculate the average of the two numbers. Once theaverage of the two numbers have been calculated, another module will be called to determine ifthe average of the two numbers is greater than 75. If the average of the two numbers is greaterthan 75, the message ‘Congratulations, you are in the top 5’, will be displayed.”1. Create a flowchart for each module that will be called. The flowcharts shouldadequately represent the logic in the scenario provided.arrow_forwardA retail company assigns a $5000 store bonus if monthly sales are $100,000 or more. Additionally, if their sales exceed 125% or more of their monthly goal of $90,000, then all employees will receive a message stating that they will get a day off. Step 2: Given the major task involved in this program, what modules might you consider including? Also describe the purpose of the module. Module Name Purpose Module getSales () Allows the user to enter the monthly sales. This module will determine if a bonus should be awarded. This module will determine if a day off should be awarded.arrow_forward
- Design a module named timesTen. The module should accept an Integer argument. When the module is called, it should display the product of its argument multiplied times 10.arrow_forwardFind the error in the following pseudocode.Module main() Declare Real mileage Call getMileage() Display “The mileage is: “, mileage, “miles.”End ModuleModule getMileage() Display “Enter the mileage: “ Input mileageEnd Modulearrow_forwardDesign a Flowchart and Pseudocode for the following Problem Dialog is a Mobile Phone company that offers the following mobile phonepackage to its customers.Monthly charges are calculated according to the following criteria The Basic Monthly Bill is CAD 40 Additional 25 CAD is charged from customers who make more than100 calls that last for more than 400 minutes Design the modular program Pass the parameters to a Module Named MobileCharges_4567 andperform all the calculations inside that Modulearrow_forward
- True or False An enum declaration can only appear inside the application’s namespace.arrow_forwardIn the code below, why is it that the displayName() module cannot print the person’s name?Start Call getInput() Call displayName()StopModule getInput() Declare String name Display "Enter your name: " Input nameEnd ModuleModule displayName() Display "Your name is: " + nameEnd Modulearrow_forward****Microsoft Visual Studios (C++)**** Write a program that will do the following: Run continuously until the user gives a command to quit Ask the user if they want to calculate the area of a circle, square, or triangle. Based on response will ask the user for the appropriate quantities then display the area to the user.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ 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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning