Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 8.3, Problem 15CP
Write a loop that asks the user “Do you want to repeat the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a loop that asks the user “Do you want to repeat the program or quit? (R/Q)”. The loop should repeat until the user has entered an R or Q (either uppercase or lowercase).
What is the output for the following loop?
int number;
bool done;
number = 2;
done = FALSE;
while (!done)
{
number = number * 2;
if (number > 12)
done = TRUE;
cout << number << endl;
}
Write a loop to request integer values as long as a multiple of 3 is entered. C++
Chapter 8 Solutions
Starting Out with Python (4th Edition)
Ch. 8.1 - Assume the variable name references a string....Ch. 8.1 - What is the index of the first character in a...Ch. 8.1 - If a string has 10 characters, what is the index...Ch. 8.1 - Prob. 4CPCh. 8.1 - Prob. 5CPCh. 8.1 - Prob. 6CPCh. 8.2 - Prob. 7CPCh. 8.2 - Prob. 8CPCh. 8.2 - Prob. 9CPCh. 8.2 - What will the following code display? mystring =...
Ch. 8.3 - Prob. 11CPCh. 8.3 - Prob. 12CPCh. 8.3 - Write an if statement that displays Digit" if the...Ch. 8.3 - What is the output of the following code? ch = 'a'...Ch. 8.3 - Write a loop that asks the user Do you want to...Ch. 8.3 - Prob. 16CPCh. 8.3 - Write a loop that counts the number of uppercase...Ch. 8.3 - Assume the following statement appears in a...Ch. 8.3 - Assume the following statement appears in a...Ch. 8 - This is the first index in a string. a. 1 b. 1 c....Ch. 8 - This is the last index in a string. a. 1 b. 99 c....Ch. 8 - This will happen if you try to use an index that...Ch. 8 - This function returns the length of a string. a....Ch. 8 - This string method returns a copy of the string...Ch. 8 - This string method returns the lowest index in the...Ch. 8 - This operator determines whether one string is...Ch. 8 - This string method returns true if a string...Ch. 8 - This string method returns true if a string...Ch. 8 - This string method returns a copy of the string...Ch. 8 - Once a string is created, it cannot be changed.Ch. 8 - You can use the for loop to iterate over the...Ch. 8 - The isupper method converts a string to all...Ch. 8 - The repetition operator () works with strings as...Ch. 8 - Prob. 5TFCh. 8 - What does the following code display? mystr =...Ch. 8 - What does the following code display? mystr =...Ch. 8 - What will the following code display? mystring =...Ch. 8 - Prob. 4SACh. 8 - What does the following code display? name = 'joe'...Ch. 8 - Assume choice references a string. The following...Ch. 8 - Write a loop that counts the number of space...Ch. 8 - Write a loop that counts the number of digits that...Ch. 8 - Write a loop that counts the number of lowercase...Ch. 8 - Write a function that accepts a string as an...Ch. 8 - Prob. 6AWCh. 8 - Write a function that accepts a string as an...Ch. 8 - Assume mystrinc references a string. Write a...Ch. 8 - Assume mystring references a string. Write a...Ch. 8 - Look at the following statement: mystring =...Ch. 8 - Initials Write a program that gets a string...Ch. 8 - Sum of Digits in a String Write a program that...Ch. 8 - Date Printer Write a program that reads a string...Ch. 8 - Prob. 4PECh. 8 - Alphabetic Telephone Number Translator Many...Ch. 8 - Average Number of Words If you have downloaded the...Ch. 8 - If you have downloaded the source code you will...Ch. 8 - Sentence Capitalizer Write a program with a...Ch. 8 - Prob. 10PECh. 8 - Prob. 11PECh. 8 - Word Separator Write a program that accepts as...Ch. 8 - Pig Latin Write a program that accepts a sentence...Ch. 8 - PowerBall Lottery To play the PowerBall lottery,...Ch. 8 - Gas Prices In the student sample program files for...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What is the meaning of the following statement (which appears in Display 1.8)? totalPeas = numberOfPods peasPe...
Problem Solving with C++ (10th Edition)
True or False: A variable may be defined in the initialization expression of the for loop.
Starting Out with Java: Early Objects (6th Edition)
Explain why software testing should always be an incremental, staged activity. Are programmers the best people ...
Software Engineering (10th Edition)
Car Loan If A dollars are borrowed at r interest compounded monthly to purchase a car with monthly payments for...
Introduction To Programming Using Visual Basic (11th Edition)
Each repetition of a loop is known as a(n) _________.
Starting Out with C++: Early Objects
Compare and contrast the break and continue statements.
Java How To Program (Early Objects)
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
- Q 18 )Which value of m ends the repetition of the following loop? a. -2 b. -1 c. -3 d. 0arrow_forwardWrite a code that will loop by inputting any integer and displays whether the integer is “POSITIVE” or “NEGATIVE”, and terminate the loop if the integer is equal to zero using while loops.arrow_forwardC++ please! Write code with one while loop that prints out these 5 lines like this (remember a newline after each line): COUNTDOWN TO ZERO: 4 COUNTDOWN TO ZERO: 3 COUNTDOWN TO ZERO: 2 COUNTDOWN TO ZERO: 1 COUNTDOWN TO ZERO: LIFT OFF!arrow_forward
- Write a loop that calculates the total of the following series of numbers: 1/30+2/29+3/28+.....30/1arrow_forwardWhat is the number of times the following loop is executed? i=2 while (i=25) is true I print outarrow_forwardHow many times is the body of the loop executed? int i = 1; while (i<10) { cout << i; if (i == 5) break; i++; }arrow_forward
- Write a loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers enteredarrow_forwardThe main difference between using do/while loop and while loop is that while loop executes the code block once then it checked if the condition is true so it will repeat the loop. True Falsearrow_forwardUsing a while loop, write a code that asks the user “What is 7 multiplied by 5?”. Whenthe user answers the question incorrectly, ask them again but give them a hinton whetherto go higher or lower. Continue to prompt for a response until they get the correctanswer. However, if they do not get the answer after 5 tries, exit the loop and tell themthe answer. USing Python!arrow_forward
- How many times will the following do loop execute and what is the output? i = 20; do { i = i/3; cout << << endl ; } while (i > 2);arrow_forwardWrite a loop that displays all the odd numbers from 1 through 49.arrow_forwardwrite a loop that calculates the (float) sum of the following series of numbers: 50 + 51 + … + 5000. The numbers should not be pre-calculated, rather the loop should cause the increment/decrement.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
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
C++ Programming Tutorial 36 - Intro to Loops; Author: Caleb Curry;https://www.youtube.com/watch?v=M3o7Y0juEP0;License: Standard YouTube License, CC-BY