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
Concept explainers
Textbook Question
Chapter 5.4, Problem 5.22CP
Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer number1 = 10, number2 = 5
Set number1 = number1 + number2
Display number1
Display number2
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. If the following pseudocode were an actual program, why would it not display the output that the programmer expects?
Declare String favoriteFood
Display "What is the name of your favorite food?"
Input favoriteFood
Display "Your favorite food is "
Display "favoriteFood"
5. Find the error in the following pseudocode.
Declare Real pi
Set 3.14159265 = pi
Display "The value of pi is ", pi
Design a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as:
247+ 129
The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed.
Python programming language
Write code that does the following:
calculate how much one Oreo cookie is concerning: calories, sodium, carbohydrate, fat
create a user input that asks how much cookies you ate
calculate how much calories, etc. you consumed
warn the user that if he/she surpasses 2000kcal he/she should stop eating these darn delicious cookies
use variables!
Chapter 5 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 5.1 - What is a repetition structure?Ch. 5.1 - What is a condition-controlled loop?Ch. 5.1 - What is a count-controlled loop?Ch. 5.2 - What is a loop iteration?Ch. 5.2 - What is the difference between a pretest loop and...Ch. 5.2 - Does the While loop test its condition before or...Ch. 5.2 - Does the Do-While loop test its condition before...Ch. 5.2 - What is an infinite loop?Ch. 5.2 - What is the difference between a Do-While loop and...Ch. 5.3 - What is a counter variable?
Ch. 5.3 - What three actions do count-controlled loops...Ch. 5.3 - When you increment a variable, what are you doing?...Ch. 5.3 - Look at the following pseudocode. If it were a...Ch. 5.3 - Prob. 5.14CPCh. 5.3 - Look at the following pseudocode. If it were a...Ch. 5.3 - Look at the following pseudocode. If it were a...Ch. 5.3 - Look at the following pseudocode. If it were a...Ch. 5.3 - Look at the following pseudocode. If it were a...Ch. 5.4 - A program that calculates the total of a series of...Ch. 5.4 - Prob. 5.20CPCh. 5.4 - Should an accumulator be initialized to any...Ch. 5.4 - Look at the following pseudocode. If it were a...Ch. 5.4 - Look at the following pseudocode. If it were a...Ch. 5.5 - Prob. 5.24CPCh. 5.5 - Why should you take care to choose a unique value...Ch. 5 - A ______ controlled loop uses a true/false...Ch. 5 - A ______ controlled loop repeats a specific number...Ch. 5 - Each repetition of a loop is known as a(n) ______....Ch. 5 - The Whi1e loop is a ______ type of loop. a....Ch. 5 - The Do-Whi1e loop is a ______ type of loop. a....Ch. 5 - The For loop is a ______ type of loop. a. pretest...Ch. 5 - A(n) ______ loop has no way of ending and repeats...Ch. 5 - A _______ loop always executes at least once. a....Ch. 5 - Prob. 9MCCh. 5 - A(n) ______ is a special value that signals when...Ch. 5 - A condition-controlled loop always repeats a...Ch. 5 - The While loop is a pretest loop.Ch. 5 - The Do-While loop is a pretest loop.Ch. 5 - You should not write code that modifies the...Ch. 5 - You cannot display the contents of the counter...Ch. 5 - Prob. 6TFCh. 5 - The following statement decrements the variable x:...Ch. 5 - It is not necessary to initialize accumulator...Ch. 5 - In a nested loop, the inner loop goes through all...Ch. 5 - To calculate the total number of iterations of a...Ch. 5 - Why should you indent the statements in the body...Ch. 5 - Describe the difference between pretest loops and...Ch. 5 - What is a condition-controlled loop?Ch. 5 - What is a count-controlled loop?Ch. 5 - What three actions do count-controlled loops...Ch. 5 - What is an infinite loop? Write the code for an...Ch. 5 - A For loop looks like what other loop in a...Ch. 5 - Why is it critical that accumulator variables are...Ch. 5 - What is the advantage of using a sentinel?Ch. 5 - Prob. 10SACh. 5 - Design a Whi1e loop that lets the user enter a...Ch. 5 - Design a Do-Whi1e loop that asks the user to enter...Ch. 5 - Design a For loop that displays the following set...Ch. 5 - Design a loop that asks the user to enter a...Ch. 5 - Design a For loop that calculates the total of the...Ch. 5 - Design a nested loop that displays 10 rows of #...Ch. 5 - Convert the Whi1e loop in the following code to a...Ch. 5 - Convert the Do-Whi1e loop in the following code to...Ch. 5 - Convert the following Whi1e loop to a For loop:...Ch. 5 - Convert the following For loop to a Whi1e loop:...Ch. 5 - Find the error in the following pseudocode....Ch. 5 - The programmer intended the following pseudocode...Ch. 5 - The programmer intended the following pseudocode...Ch. 5 - Bug Collector A bug collector collects bugs every...Ch. 5 - Calories Burned Running on a particular treadmill...Ch. 5 - Budget Analysis Design a program that asks the...Ch. 5 - Sum of Numbers Design a program with a loop that...Ch. 5 - Tuition Increase At one college, the tuition for a...Ch. 5 - Distance Traveled The distance a vehicle travels...Ch. 5 - Average Rainfall Design a program that uses nested...Ch. 5 - Celsius to Fahrenheit Table Design a program that...Ch. 5 - Pennies for Pay Design a program that calculates...Ch. 5 - Largest and Smallest Design a program with a loop...Ch. 5 - First and Last Design a program that asks the user...Ch. 5 - Calculating the Factorial of a Number In...Ch. 5 - Prob. 13PE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Write SQL commands for the following: Create two different forms of the INSERT command to add a student with a ...
Modern Database Management
This problem concerns the m. o module from Figure 7.5 and the following version of the swap, c function that co...
Computer Systems: A Programmer's Perspective (3rd Edition)
(Average speed in kilometers) Assume that a runner runs 24 miles in 1 hour, 40 minutes, and 35 seconds. Write a...
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Give the definition for the member function getElement for the class template Pair discussed in the section Syn...
Problem Solving with C++ (10th Edition)
What is wrong with the following while statement? 1 while (z = 0) { 2 sum += z; 3 }
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
What does a bounding box indicate about an object in the Designer?
Starting Out With Visual Basic (7th 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
- LargeSmall.py - This program calculates the largest and smallest of three integer values. # Declare and initialize variables here largest = None smallest = None # Prompt the user to enter 3 integer values # Write assignments, and necessary if else statements here as appropriate # Output largest and smallest number. print("The largest value is " + str(largest)) print("The smallest value is " + str(smallest))arrow_forwarddesign a program for a professor to calculate the average of the three test scores for the students and congratulate the student enthusiastically if the average is greater than 95. here is the algorithm below. write the pseudocode for this program: 1. get the first test score. 2. get the second test score. 3. get the third test score. 4. calculate the average. 5. display the average. 6. if the average is greater than 95, congratulate the student.arrow_forwardLab5- Write the program to input a positive integer and print the largest number whose cube is less than the entered number. Programming language: Javaarrow_forward
- As the name implies, it represents a value that cannot be altered over the course of the program's execution.arrow_forwardQ1: Design a program that calculate your age and displays the following information • Your name • Your address • Your telephone number • Your college majorarrow_forwardCreate a flowchart about this pseudocode Display """A series of positive numbers is expected. If the user enters a negative number, the program will stop the series and only show the sums of the positive numbers entered. \n""" Set list_of_numbers = [] While True: Display "Numbers: " Input series_of_positive_numbers If series_of_positive_numbers >= 0 then Append series_of_positive_numbers to list_of_numbers Else: Display"\nThe sum of all the positive numbers entered is", sum(list_of_numbers) End IfEnd Whilearrow_forward
- Write a pseudocode that will request the user to input his/her name, then displays his/her name afterwards.arrow_forwardCreate the pseudocode for a program that are able to measure or sense the car speed in kilometers per hour, and then, convert the speed in miles per hour (mph). The program also display the speed in km/h. If the driver exceed the speed limit of 110km/h, program will warn the driver through display with the message ‘PLEASE REDUCE SPEED’. Otherwise, the message ‘NORMAL’.arrow_forwardCan you find the reason that the following pseudocode does not perform as indicated in thecomments?// Find the error in the following pseudocode.Module main()Declare Real value, result// Get a value from the user.Display "Enter a value."Input value// Get 10 percent of the value.Call tenPercent(value)// Display 10 percent of the value.Display "10 percent of ", value, " is ", resultEnd Modulearrow_forward
- FYI: Please write the code in Pseudocode (no programming language please) 1. Write pseudocode module that loops through random numbers until it generates the "lucky number". In the main(), ask the user to enter a lucky number between 1 to 10 Validate the user’s input Pass the lucky number to the module from the main() In the module, display each number that gets randomly generated. A number in the range of 1-10 Return a count of the number of times it took to get the “luck number” Write the entire program including the Main()arrow_forwardCreate a pseudocode that is going to prompt the user for a value meanwhile the complete “total” of all the values is less then 100. This program you are creating has to track the number of times the loop will execute plus it must display the amount of times the loop executed after the loop was finished executing. Keep it simple please , Java for beginnersarrow_forwardDesign the logic for a program that allows a user to enter 10 numbers, stores the numbers in an array, then displays all of the numbers, the largest number, and the smallest. For this homework assignment you need to: create a solution algorithm using pseudocode create a flowchart using RAPTORarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY