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.3, Problem 5.15CP
Look at the following pseudocode. If it were a real program, what would it display?
Declare Integer counter
For counter = 0 To 500 Step 100
Display counter
End For
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Display random multiplication questions to the user and calculate his score. The program should end when the user enter -1
Please use the looping technique (while loop, or do-while loop).
Use Counter to calculate the score: Counter = Counter + 1
Negative Allergy
Instructions:
Continuously ask for floating-point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable.
The loop shall only terminate for the following reasons:
A negative decimal number is inputted (but still included in the total sum)
The total sum reaches 100.0 or more
Input Format
Multiple lines containing float number on each.
Input Sample
1.1 1.2 1.3 1.4 -1.0
Output Format
A line containing a float number with two decimal places.
Output Sample
4.00
Another test case:
Input sample
-2.3 -4.5 -7.8
Output Sample
-14.60
NOTE: Using do-while loop in C programming
LOOPING
General Directions:
Read and follow the instruction carefully
Python program should be executed
Use any necessary Looping structure
1. Write a program that will display the following pattern, give the value of n.
Example:
If n=4, out put
*
**
***
****
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 a program that will record the votes for one of two candidates by using the class VoteRecorder, which you...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Assuming x is 1, show the result of the following Boolean expressions: (x 0) (x 0) (x != 0) (x = 0) (x != 1)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Design an algorithm that, given a list of five or more numbers, finds the five smallest and five largest number...
Computer Science: An Overview (12th Edition)
The two mathematical models for language description are: Recognition Generation These two mathematical models ...
Concepts of Programming Languages (11th Edition)
The process used by the Java compiler to remove generic notation and substitute an actual type for type paramet...
Starting Out with Java: From Control Structures through Data Structures (3rd 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
- Sequences of Operations Find the number of operations performed in the pseudocode below. y x + x + x z + y + y + y + 2 q + x + x+y+zarrow_forwardWhat is the step count of the pseudocode below: for i=0 to 8 do for j = 0 to n do s = s+ i * j endfor endforarrow_forwardDesign the logic (flowchart and pseudocode) using arrays for a program. It allows a user to enter 10 numbers, then displays all of the numbers in reverse order, the largest number, and the smallest number.arrow_forward
- use while loop and do-while loop. put comments on what each line does and make a flowchartarrow_forwardUse c language Section C Practical Instructions: Use Codeblocks/www.onlinegdb.com to write programs. Copy and paste the program in the answer part Write a program that accepts 10 integers form the user and then displays the sum of numbers which are less than 5 and the sum of numbers. which are greater than 10 using loops. Sample Output: Enter a number 1 : 3 Enter a number 24 Enter a number 315 Enter a number 47 Enter a number 59 Enter a number 6 1 3 Enter a number 7: 1 Enter a number 8 : 5 Enter a number 9 8 Enter a number 10 11 Sum of numbers less than 5 1s 11 Sun of numbers greater than 10 is 11arrow_forwardWhile (Boolean_Expression) Statement; is the syntax of Do…while loop True False in javaarrow_forward
- Python code BASIC CALCULATOR Input: Single string of two numbers and an operation Output: The calculator should be able to do addition, subtraction, multiplication, division, modulus and exponential Example: Input an equation: 1+1 The sum is 2arrow_forward6. Integer Pairing by CodeChum Admin Now this one's a tad bit tricky, but you can definitely do it! Instructions: 1. Input five integers. 2. Add the 1st and 2nd integers together and store the sum inside a variable. 3. Add the 3rd and 4th integers together and store the sum inside a variable. 4. Multiply the two sums and raise the product result to the power of the 5th integer. 5. Print out the result. Input 1. First integer 2. Second integer 3. Third integer 4. Fourth integer 5. Fifth integer Output The first five lines will contain message prompts to input the five integers. The line contains the result. Enter integer 1: 2 Enter integer 2: 3 Enter integer 3: 3 Enter integer 4: 5 Enter integer 5: 4 Result - 2560000arrow_forwardPlease answer in c++ the sample output is also attached please reach out for any questionsarrow_forward
- Computer ProgrammingLanguage: Carrow_forwardProblem: design an algorithm which generates odd numbers between 30 and 90 and then prints them in the standard output, it should also print total sum.arrow_forwardBased on the image attached, answer with a step-by-step solution. *(Just in case this information needed, answer in c code language) Thank you inadance.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
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
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License