Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each iteration. Print values ≤ 100. Follow each number with a space. Sample output with input: 88 16 32 64 num_insects = int(input()) # Must be >= 1 ''' Your solution goes here '''
Q: 1 22 333 4444 55555
A: This question comes from Programming Language which is a paper of Computer Science. Let's discuss it…
Q: Write a program that calculates the occupancy rate for a hotel. The program should start by asking…
A: Answer: Executable Code: n = int(input("Floors on the hotel: "))occupied = 0unoccupied = 0totalRooms…
Q: Write a program that uses a loop to ask the user for a number, then to print the first 10 multiples…
A: #include <iostream>#include<conio.h>using namespace std;int main(){ int n,i,t;…
Q: Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each…
A: below we provided program with output in python lang
Q: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the…
A: Python is a high level object oriented programming language, Python is simple to understand.
Q: (h) for (int i = 0; i < 1002; i+=3) cout << "Just something"; How many iterations does the following…
A: (h) 334 (i) 5100
Q: Write a loop that iterates exactly ten times. With each iteration it should ask the user to enter a…
A: We need to iterate a for loop for 10 iterations and add every input to the variable sum. Finally…
Q: Write a program that uses for loops to perform the following steps: Prompt the user to input two…
A: THe answer is..
Q: Write a program that prompts the user to enter the number of students and each student’s name and…
A: Actually, the code has given below:
Q: Starting with a variable text containing an empty string, write a loop that prompts the user to type…
A: Note: “Since the language was not mentioned you I used python” Program Output: Define a variable…
Q: Write a loop that will calculate the sum of every third integer, beginning with i=2 (icy calculate…
A: Algorithm: Resultant algorithm for given problem is: 1. Using while statement Start Initialise the…
Q: make a while loop that if user has an invalid choice of service or food choice for item, the…
A: The answer is given in the below steps.
Q: How many lines will each of the following while loops display? A) int count = 1;while (count <…
A: A)The while loop would display the message "My favorite day is Sunday " 4 times. The sample output…
Q: test # 3 * 3 grid : board grid = [' *','* ','*','*','*','*','*','*','*'] # we have two players…
A: here have to determine about given python problem.
Q: Implement the following: Write a loop that prints out the following numbers. Make sure to precisely…
A: Since you have not mentioned the programming language in which you need this to be done. so i have…
Q: Write a program that calculates the balance of a savings account at the end of a period of time. It…
A: C++ program calculates the balance of a savings account at the end of a period of time. It should…
Q: How many times will the loop repeat? for (int x = 10; * >= 1; x++) ( } //Some codes...
A: Introduction: In this question we need to show the programming approach and solve the question which…
Q: Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the…
A: Please find the answer below :
Q: Suppose your friend, Alice is trying to find all the odd numbers that are between X and Y. You want…
A: Step-1: Start Step-2: Start a for loop i = 92 to 1092 Step-3: Check if every i is not divisible by…
Q: Write a program that asks the user for a positive integer value and that uses a loop to validate the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C++ FOR THE SOLUTION. Define…
Q: Write a program that uses a while loop to enter any number of positive integers. When the loop ends,…
A: Given: Write a program that uses a while loop to enter any number of positive integers. When the…
Q: Write a program that draws a graphic consisting of 50 rectangles with randomly generated sides and…
A: The rectangle is specified by two points. Those points have to be diagonally opposite corners.…
Q: It then has the user enter that number of scores and computes the average.
A: n=int(input("Enter number of tests : ")) # reading number of testsi=1s=0while(i<=n):…
Q: Write a program that prints all letters that occur a single time in a string. For example, if the…
A: To write a java program that prints all characters that occur a single time in a string
Q: How many times the operation inside the while loop will be executed? n is a positive number and…
A: The given C code is, int j=n; while ( j>0 ) j = j/4 ; 1 iteration 2 iteration 3…
Q: Write a program that calculates the occupancy rate of the 120 suites (20 per floor) located on the…
A: Program code: #include <iostream> using namespace std; int main() { const int OCC = 120;…
Q: Write Java code that uses a do...while loop that prints even numbers from 2 through 10. Cdit Vigu…
A: Algorithm Start Var num=2 do if(num%2==0), go to step 5 else to step 6 Print(num) num++…
Q: Write a program that uses a loop to display Pattern A below, followed by another loop that displays…
A: Given: To write a program to print two given patterns side by side.
Q: in python "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B,…
A: user_score = 0simon_pattern = input()user_pattern = input() for i in range(len(simon_pattern)):…
Q: Use nested loop in Java language. This program asks the user to enter an integer from 3 to 9 * and…
A: import java.util.Scanner; //create a class //you can change the name of the main class accordingly…
Q: By using one loop only, write a program that p followed with the corresponding lower-case l i.e.…
A: I am attaching the c++ code with the required comments and output screenshot.
Q: Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each…
A: You may have encountered this error: File "main.py", line 4 print(num_insects, end= ' ')…
Q: Write a program with a loop that lets the user enter a series of integers, followed by 99 to signal…
A: Code; #include<iostream> using namespace std; int main() { //declare variables needed…
Q: What will the following code output? For an infinite loop, type "IL" (without the quotes). int…
A: Output of the given C++ code
Q: Using javascript Simulate rolling two dice by getting two random integers from 1 to 6. a. Count how…
A:
Q: Write a software called Digits that asks the user for a positive integer, then reverses the number…
A: Because no programming language is mentioned here. As a result, we're offering a Java-based…
Q: A loop should sum all inputs, stopping when the input is 0. If the input is 2 4 6 0, sum should end…
A: Here, the following code is given, intsum;int currVal;XXX;currVal = scnr.nextInt();while (YYY)…
Q: Write a program that will predict the size of a population of organisms. The program should ask the…
A: PROGRAMING CODE: #include <iostream>#include <iomanip>using namespace std; int main(){…
Q: The following is an example of which kind of loop? (initial-action; loop-continuation-condition;…
A: Given Question: To choose the correct option.
Q: Write a loop that reads positive integers from standard input and that terminates when it reads an…
A: To check the condition that the number is positive and print the sum, count of even and odd integers…
Q: Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the…
A: According to the Question below the Solution: Output:
Q: CHALLENGE ACTIVITY 5.8.2: Nested loops: Print seats. Given num_rows and num_cols, print a list of…
A: PROGRAM CODE: num_rows = int(input())num_cols = int(input())#create a number to start counting from…
Q: What will the following code output? For an infinite loop, type "IL" (without the quotes). int…
A: The question is to find the output of the C++ code.
Q: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the…
A: Required Python Code with comment provided below :
Q: How many times will the following loop execute? for(j - 1:j<- 10. j-j-1) O a. 9 O b. 10 O c. forever…
A: The answer is..
Q: Create a loop that counts from 0 to 10, and prints odd numbers to the .screen
A: continue If the continue statement is execute then skip the remaining steps. So any number of…
Q: It needs to be written in python and the chapter is iterating lists in for loops The non-gray space…
A: Programming instructions: Prompt the user to enter how many numbers the user wants to enter into…
Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each iteration. Print values ≤ 100. Follow each number with a space.
Sample output with input: 88 16 32 64
num_insects = int(input()) # Must be >= 1
''' Your solution goes here '''
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each iteration. Print values ≤ 100. Follow each number with a space.Sample output with input: 88 16 32 64 this is what I have so far: num_insects = int(input()) # Must be >= 1 while num_insects <= 100:print(num_insects, end= ' ')num_insects *= 2 but its not workingCHALLENGE ACTIVITY 5.10.2: Simon says. "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares each character of the two strings. For each matching character, add one point to user_score. Upon a mismatch, end the loop.Sample output with inputs: 'RRGBRYYBGY' 'RRGBBRYBGY' User score: 4 Use Python, please.CHALLENGE ACTIVITY 5.3.3: While loop: Insect growth. Given positive integer num_insects, write a while loop that prints, then doubles, num_insects each iteration. Print values ≤ 100. Follow each number with a space.Sample output with input: 88 16 32 64 Use Python please!
- Starting with the following code, add a loop that will prompt the user for the number of math questions the user would like to be presented with: import randomfirstnum = random.randrange(1,11) # return an int from 1 to 10secondnum = random.randrange(1, 11)compsum = firstnum + secondnum # adds the 2 random numbers together# print (compsum) # print for troubleshootingprint("What is the sum of", firstnum, " +", secondnum, "?") # presents problem to useradded = int(input("Your answer is: ")) # gets user inputif added == compsum: # compares user input to real answer print("You are correct!!!")else: print ("Sorry, you are incorrect")Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out the sum of all the even integers read and the sum of all the odd integers read(The two sums are separated by a space). Declare any variables that are needed.Implement the following: Write a loop that prints out the following numbers. Make sure to precisely match the output format below.Write your code in the ANSWER area provided below (must include comments if using code is not covered in the course). Example Output8 15 22 29 36 43 50 57 64 71 78
- Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number with a space. After the loop, print a newline. Ex: If numInsects = 16, print:16 32 64 128 c++Write a while loop that prints userNum divided by 4 (integer division) until reaching 2 or less. Follow each number by a space. Example output for userNum = 160:40 10 2Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number with a space. After the loop, print a newline. Ex: If numInsects = 16, print:16 32 64 128 C++ #include <iostream>using namespace std; int main() { int numInsects; cin >> numInsects; // Must be >= 1 /* Your solution goes here */ return 0;}
- Write a program that displays the pattern show in the* sample executable.** Type of loop-> your favorite (you must use a pair of* nested loops)* Hints:* 1) Use variables that increments* 2) When running the sample, use values between 61 and* 76 for the number of columns, values between 16 and* 21 the number of rows* 3) Start with a rectangular array of "X" then figure out* how to create one of the upward lines and then the* backwards lines and then both lines*Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by exactly one space. Declare any variables that are needed.Write a program that randomly chooses between three different colors for displaying text on the screen. Use a loop to display twenty lines of text, each with a randomly chosen color. The probabilities for each color are to be as follows: white = 30%, blue = 10%, green = 60%. Hint: generate a random integer between 0 and 9. If the resulting integer is in the range 0-2, choose white. If the integer equals 3, choose blue. If the integer is in the range 4-9, choose green.