Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 2DE
Find the error in the following pseudocode.
Module main()
Call getCalories()
End Module
Module getCalories()
Declare Real calories
Display "How many calories are in the first food?"
Input calories
Declare Real calories
Display "How many calories are in the second food?"
Input calories
End Module
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Find the error in the following pseudocode:
Module main()
Call getCalories()
End Module
Module getCalories()
Declare Real calories
Display "How many calories are in the first food?"
Input calories
Declare Real calories
Display "How many calories are in the second food?"
Input calories
End Module
For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).
ind the error in the following pseudocode.Module main()Declare Real mileageCall getMileage()Display "You've driven a total of ", mileage, " miles."End ModuleModule getMileage()Display "Enter your vehicle's mileage."Input mileageEnd Module
write code python language palese
Chapter 3 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 3.1 - What is a module?Ch. 3.1 - Prob. 3.2CPCh. 3.1 - Prob. 3.3CPCh. 3.1 - Prob. 3.4CPCh. 3.1 - Prob. 3.5CPCh. 3.2 - In most languages, a module definition has what...Ch. 3.2 - Prob. 3.7CPCh. 3.2 - Prob. 3.8CPCh. 3.2 - Prob. 3.9CPCh. 3.3 - What is a local variable? How is access to a local...
Ch. 3.3 - What is a variables scope?Ch. 3.3 - Prob. 3.12CPCh. 3.3 - Prob. 3.13CPCh. 3.4 - Prob. 3.14CPCh. 3.4 - What are the variables that receive pieces of data...Ch. 3.4 - Prob. 3.16CPCh. 3.4 - Prob. 3.17CPCh. 3.4 - Prob. 3.18CPCh. 3.5 - What is the scope of a global variable?Ch. 3.5 - Give one good reason that you should not use...Ch. 3.5 - Prob. 3.21CPCh. 3 - A group of statements that exist within a program...Ch. 3 - Prob. 2MCCh. 3 - The first line of a module definition is known as...Ch. 3 - Prob. 4MCCh. 3 - Prob. 5MCCh. 3 - A design technique that programmers use to break...Ch. 3 - Prob. 7MCCh. 3 - A _____ is a variable that is declared inside a...Ch. 3 - A(n) ____ is the part of a program in which a...Ch. 3 - A(n) ____ is a piece of data that is sent into a...Ch. 3 - A(n) ____ is a special variable that receives a...Ch. 3 - When _____, only a copy of the argument's value is...Ch. 3 - When ____, the module can modify the argument in...Ch. 3 - A variable that is visible to every module in the...Ch. 3 - When possible, you should avoid using _____...Ch. 3 - The phrase divide and conquer means that all of...Ch. 3 - Prob. 2TFCh. 3 - Module names should be as short as possible.Ch. 3 - Prob. 4TFCh. 3 - A flowchart shows the hierarchical relationships...Ch. 3 - Prob. 6TFCh. 3 - A statement in one module can access a local...Ch. 3 - In most programming languages, you cannot have two...Ch. 3 - Programming languages typically require that...Ch. 3 - Most languages do not allow you to write modules...Ch. 3 - When an argument is passed by reference, the...Ch. 3 - Prob. 12TFCh. 3 - Prob. 1SACh. 3 - Prob. 2SACh. 3 - Prob. 3SACh. 3 - What is a local variable? What statements are able...Ch. 3 - In most languages, where does a local variables...Ch. 3 - What is the difference between passing an argument...Ch. 3 - Prob. 7SACh. 3 - Design a module named timesTen. The module should...Ch. 3 - Examine the following pseudocode module header,...Ch. 3 - Look at the following pseudocode module header:...Ch. 3 - Assume that a pseudocode program contains the...Ch. 3 - Design a module named getNumber, which uses a...Ch. 3 - What will the following pseudocode program...Ch. 3 - What will the following pseudocode program...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the potential error in the following...Ch. 3 - Prob. 4DECh. 3 - Kilometer Converter Design a modular program that...Ch. 3 - Prob. 2PECh. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Calories from Fat and Carbohydrates A nutritionist...Ch. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Prob. 11PE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
In Exercises 1 through 52, determine the output produced by the lines of code. DimdtlAsDate=2/1/20162016wasalea...
Introduction To Programming Using Visual Basic (11th Edition)
Write a program that asks the user to input an integer named numDoubles. Create a dynamic array that can store ...
Problem Solving with C++ (9th Edition)
Type in and run the five programs presented in this chapter. Compare the output produced by each program with t...
Programming in C
Using an example of a component that implements an abstract data type such as a stack or a list, show why it is...
Software Engineering (10th Edition)
Consider the example code shown in Figure 7-10. What changes would you need to make to ensure that the applicat...
Modern Database Management (12th Edition)
Four prospectors with only one lantern must walk through a mine shaft. At most, two prospectors can travel toge...
Computer Science: An Overview (12th 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
- Python programming languagearrow_forwardInstruction: Create a notation resembling a simplified programming language with the input and output of a counting problem. Write a program with the specified input and output: Create a program for geometric sequence (initial value and common ratio)arrow_forwardn this assignment you will write a computer program from scratch using the Python programming language. This program will function as a simple calculator. Objectives Write a simple Python program that performs arithmetic operations based on the user input Stage 1: A simple calculator Your calculator should provide the following arithmetic and control operations. Arithmetic Operations Addition (+) add(a,b) Subtraction (-) subtract(a,b) Multiplication (*) multiply(a,b) Division (/) divide(a,b) Power (^) power(a,b) Remainder (%) remainder(a,b) Control Operations Terminate (#) Reset ($) Write a function select_op(choice) to select the appropriate mathematics function based on the users selection. The behavior of the program should be as follows: The program should ask the user to specify the desired operation (addition/subtraction/multiplication/division/power/remainder/terminate/reset). You can…arrow_forward
- Course Level Programming Assignment - Programming a Calculator using Python In this assignment you will write a computer program from scratch using the Python programming language. This program will function as a simple calculator. Objectives Write a simple Python program that performs arithmetic operations based on the user input Stage 1: A simple calculator Your calculator should provide the following arithmetic and control operations. Arithmetic Operations Addition (+) add(a,b) Subtraction (-) subtract(a,b) Multiplication (*) multiply(a,b) Division (/) divide(a,b) Power (^) power(a,b) Remainder (%) remainder(a,b) Control Operations Terminate (#) Reset ($) Write a function select_op(choice) to select the appropriate mathematics function based on the users selection. The behavior of the program should be as follows: The program should ask the user to specify the desired operation…arrow_forwardCourse Level Programming Assignment - Programming a Calculator using Python In this assignment you will write a computer program from scratch using the Python programming language. This program will function as a simple calculator. Objectives Write a simple Python program that performs arithmetic operations based on the user input Stage 1: A simple calculator Your calculator should provide the following arithmetic and control operations. Arithmetic Operations Addition (+) add(a,b) Subtraction (-) subtract(a,b) Multiplication (*) multiply(a,b) Division (/) divide(a,b) Power (^) power(a,b) Remainder (%) remainder(a,b) Control Operations Terminate (#) Reset ($) Write a function select_op(choice) to select the appropriate mathematics function based on the users selection. The behavior of the program should be as follows: The program should ask the user to specify the desired operation…arrow_forwardFollow the instructions below: In the game Rock Paper Scissors, two players simultaneously choose one of three options: rock, paper, or scissors. If both players choose the same option, then the result is a tie. However, if they choose differently, the winner is determined as follows: Rock beats scissors, because a rock can break a pair of scissors. Scissors beats paper, because scissors can cut paper. • Paper beats rock, because a piece of paper can cover a rock. Create a game in which the computer randomly chooses rock, paper, or scissors. Let the user enter a number 1, 2, or 3, each representing one of the three choices. Then, determine the winner. Save the application as RockPaperScissors.java. (In the nhantan uCarrow_forward
- Computer ProgrammingLanguage: CConditional Statementsarrow_forwardDesign and write a Python program for exercise #19: Please label your steps with comments (#) on your programarrow_forwardModule main() // Local variables Declare Integer gramsFat, calories // Get fat grams Set gramsFat = getFat() // Get calories Set calories = getCalories(gramsFat) // Show percent calories from fat Call showPercent(gramsFat, calories) End Module // The getFat function gets grams of fat Function Integer getFat () Declare Integer inputAmount // enter count Display “Enter grams of fat: “ Input inputAmount // validate rate While inputAmount < 0 Display “Quantity must not be less than 0!” Display “Enter a valid quantity.” Input inputAmount End While return inputAmount End Function // The getCalories function gets number of calories Function Integer getCalories(gramsFat) Declare Integer inputAmount, maxCalories Set maxCalories = gramsFat * 9 // enter count Display “Enter number of calories: “…arrow_forward
- Problem Description Write a JAVA program that will read all words from a passage and store them in BST. The program then will display a menu and perform the following task: Delete a word. If a word exists, update the word frequency otherwise print word not exist. Search a word. If a word exists, print the word and its frequency otherwise print not exist. Add a new word. If the word is in the passage, update its frequency. Print all words and their frequency in ascending order. Input The input of this program is a passage. A passage consists of N words and symbols. Symbols that will be considered in the passage are full stop (.), comma (,), question mark (?) and exclamation mark (!). The passage will have M unique words, where the M is less than or equal to N. Followed by the input code and the required data as specified in the sample input-output. Input Stay at home, stay safe and stay healthy. Practice social distancing at work and at home. Help reduce the risk of infection…arrow_forwardChallenge task The distance a vehicle travels can be calculated as follows: distance = speed * time For example, if a vehicle starts a trip at 10 miles and travels 40 miles per hour for 4 hours, the distance traveled is 170 miles, the first 2 hours the distance=80+10=90, and the second one=160+10=170. Write a program which reads the speed of a vehicle (in miles per hour) and how many hours it has traveled. The program should then use a for loop to display the distance the vehicle has traveled for every 2 hours of that time period. 1 Roserio ףי Constraints Nonearrow_forwardThe Lottery Problem: • The lottery draws a number that is the winning number • The number should be between 0 and 999 • Have someone play • The person tells how many tickets they want • The person always does “quick pick” (let the computer pick the number for them) and gets one number between 0 and 999 for each ticket bought • The program reports how many tickets win of the ones bought • NOTE: A ticket “wins” if it matches the winning number previously chosen • Write working code with at least one function and one sub other than “main”arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ 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 LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher: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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Structured Chart; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=vdUO-sGA1DA;License: Standard YouTube License, CC-BY
Introduction to Structure Charts; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=QN2bjNplGlQ;License: Standard Youtube License