Write a do while loop that uses the loop control variable to take on the values 0 through 10. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Execute the program by clicking Run and verify that the output is corre
Q: how many times is the body of loop below executed? int ounter=10; while (counter<20) {…
A: Actually, in while loop up to condition true the statement will execute. whenever condition false…
Q: In this project you will implement a program that simulates a simple text editor with the undo/redo…
A: The complete code is given below with output .
Q: Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each…
A: This program can be implemented using a while loop in JAVA, here is the code and output attached.
Q: Write a program that uses a while loop to store goals and assists for Lightning players in a text…
A: Here have to determine python code for write in file.
Q: Write a program that prompts the user to enter a decimal number that has two-digits decimal part and…
A: The code is done in C++ programming language. The code and output is given below
Q: Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each…
A: Import neccesary libraries. Initialize variable. Ask for user input. Perform calcualtion in loop.
Q: Write a for loop that calculates the total of the following series of numbers 1 2 + 29 4 + 28 3 30 +…
A: The main objective of the java program, seriessum.java is to calculate the sum of the below series.…
Q: Using Python- Read an parse the runtracker_2021.txt file to: compute the monthly totals for each…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: fnal int NUMLLOOPS int numberofTimes NUMLLOOPS; while(numberofTimes++ < NUM LOOPS)…
A: 1. Loop control variable: In the given code, the loop control variable is “numberOfTimes” because,…
Q: You have been asked to write a program that will allow your client Tigger Movie Rentals to keep…
A: #This function lists all the inventory names from the file.def display():with open("movies.txt") as…
Q: In order to get into your secret club, someone needs to know the password! Write a program that asks…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT------------
Q: C++ please! Write code with one while loop that prints out these 5 lines like this (remember a…
A: The answer is
Q: Please implement a program by using a While loop. The program must prompts a user for a string (one…
A: The above question is solved in step 2 :-
Q: This program will read in a series of names, along with an associated gender, from an input file of…
A: The program is written in Java. Please find the source code in step 2.
Q: In this lab, you work with the same Python program you worked with in Labs 5-1 and 5-3. As in those…
A: Loops refer to the technique used to repeat a group of statements until a given condition is true. A…
Q: JAVA CODE PLS THANK YOU 4. A Shorter Three by CodeChum Admin Numbers in threes are awesome! But…
A: Java Code: public class Main{ public static void main(String args[]) { for (int i=1;…
Q: or this task you are asked to write a program that will open a file called “story.txt” and count the…
A: Note: Since you have not provided the language to write the code so I am using Java language to…
Q: Which of the following is an entry- * ?controlled loop A) do-while loop O B) while loop O C) for…
A: Loop is a repetition of a set of statements until a specified condition is met or true. The loop…
Q: 2) Start with a working copy of loop-2.py from last lab, and name it Welcome to our counting…
A: The python code for counting the numbers , here we accepted the input from the user for smaller…
Q: Write a software called Digits that asks the user for a positive integer, then reverses the number…
A: PROGRAM INTRODUCTION: Include the required header files. Declare and initialize the required global…
Q: Write a program named filereader.py that reads and displays the data in friends.txt. This program…
A: 1. Open the file 2. Read the file line by line and split each line by Space and store it into the…
Q: Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each…
A: Step 1 : Start Step 2 : Take input for the userNum from the user using the scanner object. Step 3 :…
Q: Write a do-while loop that continues to prompt a user to enter a number less than 100, until the…
A: Program: //include the header file import java.util.Scanner; //defintion of class public class…
Q: A teacher has asked all her students to line up single file according to their first name. For…
A: Given: A teacher has asked all her students to line up single file according to their first name. For…
Q: Please Help-- - java processing Create a T.V static program create a setup in draw and in the draw…
A: lease Help-- - java processing Create a T.V static program create a setup in draw and in the draw…
Q: This program will read in a series of names, along with an associated gender, from an input file of…
A: The program is written in Java. Please find the source code in step 2.
Q: I am am supposed to prompt the user to enter the text to open the file. I have the code bold so you…
A: The command for infile are as follows:
Q: Part B: Draw Something In this portion of the lab you will draw an inverted triangle using…
A: for i in range(10,0,-1): // for variable 'i' ranging from 10 to 1 print('*'*i)…
Q: In Python, create a program that meets the following requirements: Take two integers from the…
A: Program code: #Prompt the user to enter first integer number1=int(input("Enter number 1 : "))…
Q: Our users do not want to have to re-enter the price levels each time the app starts. Therefor, we…
A: We have to make two functions Functions are implemented below
Q: Counting the character occurrences in a file For this task you are asked to write a program that…
A: Solution: Used system call fopen, we have opened the file "file1.txt" in reading mode System call…
Q: Write a do while loop that writes the numbers from 10 to 100 that are even and multiple of 8. The…
A: Required: Write a do while loop that writes the numbers from 10 to 100 that are even and multiple of…
Q: Write a program in a script file that finds the smallest odd integer that is divisible by 11 and…
A: n=1; while 1 if mod(n,2) ~= 0 if mod(n,11) == 0 if sqrt(n) > 132…
Q: Using a Counter-Controlled whileLoop Summary In this lab, you use a counter-controlled while loop…
A: Program: #include<iostream> using namespace std; int main(){ string head1 = "Number: ";…
Q: How many times will the following loop ?execute? What is the output ;int num1 = 5, num2 = 20 do }…
A: Given num1=5 num2=20 do while loop, first executes the instructions inside the loop and then…
Q: Write a loop that reads positive integers from standard input, printing out those values that are…
A: I am attaching the complete working code in c++. Please go through it.
Q: (In java) Lab6C: Cha-Ching For this lab, use a do-while loop. A sentinel loop is a loop (a special…
A: ANSWER:-
Q: Write a program that creates three 2-digits addition questions for the second grade students. 1. If…
A: A required C++ program is as follows, #include<iostream> #include<ctime>…
Q: Write a program in Python that prompts the user to enter 3 names (HINT: use a FOR loop) Have your…
A: Python code for capturing user input 3 names, for loop, write names in 'names.txt' in reading the…
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: So below is the question of the problem for my class. I have attached a picture of my python…
A: List index out of range happens when you try to access the elements that are outside the range of…
Q: Write a program in Python that sums a series of (positive) integers entered by the user, excluding…
A: Use a while loop to iterate and here we check whether to enter loop or not based on the input value…
Q: Write a loop of your choice that continues to read an integer x as long as x is not in the range of…
A: Program Approach: Including necessary header file Defining the main method Declaring integer…
Q: PYTHON PROGRAMMING Write a program that will ask a user to input a word and that will check if the…
A: Basically, user will be asked to enter number of strings as input, until one wants to quit oneself…
Q: You will nood to use mutable variables for this task, along with a while loop and ifstotemornis).…
A: ANSWER: Mutable Data type in Python: (1) Indexing List and Tuple Output (2) Changing Values…
Q: Counting the character occurrences in a file For this task you are asked to write a program that…
A: ANSWER: Don't forget save file1.txt before run the code. EXPLANATION: Used system call fopen,we…
Q: Given the following pseudocode that correlates with climbing 10 steps in a flight of stairs, answer…
A: The given for loop iterates from step=1 to 10 Prints step number in every step If step=10 it prints…
Q: Write a program that calculates the equivalent resistance of a circuit. n electrical resistors with…
A: NOTE: - The program is implemented in the C language. EXPLANATION: - Integer[] of resistance to…
Q: Using any loop of your choice create a program that will prompts the user for two numbers and do…
A: Note: The given program is in C programming language.
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
Using a do whileLoop
Summary
In this lab, you work with the same Java
Instructions
1.Ensure the file named NewestMultiply.java is open.
-
Write a do while loop that uses the loop control variable to take on the values 0 through 10.
-
In the body of the loop, multiply the value of the loop control variable by 2 and by 10.
-
Execute the program by clicking Run and verify that the output is correct.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Using a Counter-Controlled whileLoop Summary In this lab, you use a counter-controlled while loop in a Java program provided for you. When completed, the program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. The data file contains the necessary variable declarations and some output statements. Instructions Ensure the file named Multiply.java is open. Write a counter-controlled while loop that uses the loop control variable to take on the values 0 through 10. Remember to initialize the loop control variable before the program enters the loop. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Remember to change the value of the loop control variable in the body of the loop. Execute the program by clicking Run. Record the output of this program.• Use a while loop • Use multiple loop controlling conditions • Use a boolean method • Use the increment operator • Extra credit: Reuse earlier code and call two methods from main Details: This assignment will be completed using the Eclipse IDE. Cut and paste your code from Eclipse into the Assignment text window. This is another password program. In this case, your code is simply going to ask for a username and password, and then check the input against four users. The program will give the user three tries to input the correct username-password combination. There will be four acceptable user-password combinations: • alpha-alpha1 • beta-beta1 • gamma-gamma1 • delta - delta1 If the user types in one of the correct username-password combinations, then the program will output: "Login successful." Here are a couple of example runs (but your code needs to work for all four user-password combinations): Username: beta Type your current password: beta1 Login successful. Username: delta Type…3 Using a do while Loop Summary In this lab, you work with the same Java program you worked with in Labs 5-1 and 5-3. As in those earlier labs, the completed program should print the numbers O through 10, along with their values multiplied by 2 and by 10. However, in this lab you should accomplish this using a do while loop. Instructions 1.Ensure the file named NewestMultiply.java is open. 2. Write a do while loop that uses the loop control variable to take on the values O through 10. 3. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. 4. Execute the program by clicking Run and verify that the output is correct. Grading When you have completed your program, click the Submit button to record your score. == ▬▬ NewestMultiply.java 1 // NewestMultiply.java 2 // with these values multiplied by 2 and by 10. 3 // Input: None. 4 // Output: Prints the numbers through 10 along with their values multiplied by 2 and by 10. 5 10 11 12 13 14 15 16 17 18 19 20…
- This test can only be taken once. Force Completion This test can be saved and resumed at any point until time has expired. The timer will continue to run if you leave the test. Your answers are saved automatically. • Show Timer ¥ Question Completion Status: QUESTION 1 What is the difference between a while loop and a do-while loop? O while loop checks the condition before the loop begins, whereas the do-while loop executes the body at least once before checking the condition. O while loop is used for counter-controlled and do-while, is used for a sentinel loop. O while loop is used for selection controlled and do-while is used for an infinite loop. O while loop is used for endless controlled control and do-while, is used for counter-controlled loop. Save All Ans Click Save and Submit to save and submit. Click Save All Answers to save all answers. DELLPlease solve this using java Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for names and birth-dates until the user enters the sentinel value “ZZZ” for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birth-date or an error message if the name has not been previously entered. The loop continues until the user enters “ZZZ” for a name.USE JAVA Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name. An example of the program is shown below: Enter a name Lan Enter birthdate with slashes between the month, day, and year 12/25/1983 Enter a name or ZZZ to quit Marylouise Enter birthdate with slashes between the month, day, and year 2/20/1992 Enter a name or ZZZ to quit Arminda Enter birthdate with slashes between the month, day, and year 8/30/1992 Enter a name or ZZZ to quit Gudrun…
- Using a Sentinel Value to Control a while Loop Summary In this lab, you write a while loop that uses a sentinel value to control a loop in a Java program that has been provided. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars the patron awards to the Guide’s featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, you should display the average star rating for the movie. Instructions Ensure the file named MovieGuide.java is open. Write the while loop using a sentinel value to control the loop, and write the statements that make up the body of the loop to calculate the average star rating. Execute the program by clicking Run. Input the following: 0, 3, 4, 4, 1, 1, 2, -1 Check that the average…Java Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name.Please write a loop that prints multiples of 3 from 300 down to 3. This will be a java programming line.
- Write a while loop which prompts the user for the name of a drink and the cost. Add these new items to the drinks_dict. When the user enters "quit", exit the loop. Be sure to cast the value for the cost to a float. Spring Water 1.25 Sparkling Water 2.00 exit Use the values() method to access the values in drinks_dict. Use a loop to print out the values. Use the keys() method to access the keys in drinks_dict. Use a loop to print out the keys. Print the code and the output from the Python Shell. Compute the sum of all of the values for the drinks. Print out the sum. Print the code and the output from the Python Shell. Write a function named find_drink_function(0 that takes two parameters a dictionary and a key: If the key is in the dictionary, return True, otherwise return False. Call the function from within main with the following arguments: drinks_dict and "Tea". Assign the returned Boolean value to a variable found. Print out the value of found. Print the code and the output from…Design and implement an application that prints the verses of thesong “The Twelve Days of Christmas,” in which each verse addsone line. The first two verses of the song areOn the 1st day of Christmas my true love gave to meA partridge in a pear tree.On the 2nd day of Christmas my true love gave to meTwo turtle doves, andA partridge in a pear tree.Use a switch statement in a loop to control which lines getprinted. Hint: Order the cases carefully and avoid the breakstatement. Use a separate switch statement to put the appropriate suffix on the day number (1st, 2nd, 3rd, etc.). The final verseof the song involves all 12 days, as follows:On the 12th day of Christmas, my true love gave to meTwelve drummers drumming,Eleven pipers piping,Ten lords a leaping,Nine ladies dancing,Eight maids a milking,Seven swans a swimming,Six geese a laying,Five golden rings,Four calling birds,Three French hens,Two turtle doves, andA partridge in a pear tree Try to ans in 30 minImplement 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