Write a program that prompts the user to input two integers. Using a while loop, output the multiples of 7 between the two integers.
Q: Write a program that asks the user for a positive nonzero integer value. The program should use a…
A: Java Code: import java.util.Scanner;public class Main{ public static void main(String[] args) { int…
Q: Write a python program that prompts the user to enter a series of strings, but with each string…
A: s=u=0print("Enter a string and a number")while(1): a=input("Enter a string :") if a=='0':…
Q: Write a python program to continuously add input numbers till“Done" word is given input. ***You…
A: The given problem is related to python programming where the requirement is to take an infinte loop.…
Q: Write a program with a loop to computer the sum of all the even numbers from 2 to 100 inclusive.
A: Given: Write a program with a loop to computer the sum of all the even numbers from 2 to 100…
Q: Using Python 3 Write a while loop that prints user_num divided by 2 until user_num is less than 1.…
A: We need to provide python code with a while loop that prints user_num divided by 2 until user_num is…
Q: Write a program that reads an integer between 11 and 9999 and adds all the digits in the integer,…
A: Start For 3 times Input number Find the sum of digits Print sum Stop
Q: Write a program by using a loop to calculate the total of the following: 1/50+2/49+3/48+.....+50
A: Please find the answer below :
Q: Write a loop to print all positive values less then x on a single line. Example output Enter a value…
A: Step 1 : in main function create a int variable x Step 2 : show message for entering a x value and…
Q: Write a Python program that asks the user to enter a non-negative number (float). If the user does…
A: Program Approach – Import the essential modules. Prompt user to enter the number. Use WHILE loop…
Q: write a loop that will sum the odd integers from 3 to 17 and print that sum
A: As no programming language is mentioned it is solved using basic C++
Q: Write a program that: 1. Reads in a number: numStar 2. Prints a row of (*) that is numStar long,…
A: C code for above : #include<stdio.h> int main(){ //declarations int numStar;…
Q: Using loops, write a program that reads 5 one-digit integer number (from 0 to 9) from the user and…
A: Declare the variables Get 5 numbers as user input by looping from 1 to 5. Get the length of the…
Q: Write a python program that emplys the use of a while loop to accept the name, age and salary of 25…
A: use three arrays to hold name , age and salary syntax of while loop initialization in variable…
Q: Write a program that prints decrements of 7 on a single * line. The program prompts the user for the…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in…
Q: Write a program using Nested loops that ask the user to input number of rows from 1 to 13, if the…
A: 1) Since programming language is not specified, I have written program in python 2) Below is program…
Q: Write a program to sum the numbers from 1 to 10 with increment 0.5 by using while loop
A: def solve(): sum = 0 i = 0 cnt = 1 while i < 10: if i == int(i):…
Q: write a program with a loop that asks the user to enter a series of negative numbers. The user…
A: logic:- iterate an infinite loop read temp if temp>0 break loop else append…
Q: Write a program that uses a Scanner to ask the user for a double. Then write a loop that counts from…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Write a program that uses nested loops to display the diamond pattern shown below.…
A: z
Q: Write a program to prompt for inputting an integer N, then enter N integers (a loop is needed),…
A:
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 asks the user for a rectangle's length and width. Then it prints a rectangle of…
A: #include <iostream> using namespace std; int main() { int len,width = 0; while (true)…
Q: Write a loop to request integer values from the console until an even value is entered. Example…
A: import java.util.Scanner; public class Practice { public static void main(String args[]) {…
Q: Write a program that uses nested loops to display the triangle pattern shown below. + +++ +++++…
A: Code//Header Files#include<iostream>using namespace std;// start main int main (){int i, j;for…
Q: The following loop will run X=-3 while x<--1: print (x) x+=1
A: I have provided solution of this question in step 2
Q: python Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output…
A: Steps to perform given python question: Take an input from user. Store the user input in a…
Q: Write a program using while loop to read 10 values of K calculate the value of M if value of K is…
A: Note: As the language is not specified answer written in C++ #include <iostream>using…
Q: Commodore 64) Write a program to count to 10 and print every loop value on the screen. Your output…
A: Solution :: Let's see first what is assembly language ? Answer :: An assembly language is the type…
Q: Write a program that runs like a cashier in a store. The program should use a while loop and prompt…
A: Program code: #variable declaration loopCashier = True itemCount = 0 finalAmount = 0 # Looping the…
Q: Write a program on eclipse using a while loop that calculates the sum of ten numbers, from 11 to 20,…
A: Given: Write a program on eclipse using a while loop that calculates the sum of ten numbers, from…
Q: Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output with…
A: #Python program to print natural number fro 1 to n#using while loopnum=int(input("Enter maximum…
Q: Write a program to calculate the following series by using loop S= (x^0 /0!)+ x^1/1! + x^2/2! + n!…
A: To do: Write a program for the given series
Q: Write a program that output the following using loops. value of x : 19 value of x : 18 value of…
A: Given: Write a program that output the following using loops. value of x : 19 value of x :…
Q: Write a Basic program to calculate Y value if the condition (Y <0) break the loop and Y equation as…
A: Algorithm: Start Read n value Initialize x and d to 1 Initialize y to 0 Calculate…
Q: Write a program that: 1. Reads in a number: numStar 2. Prints a row of (*) that is numStar long,…
A: In while loop you can iterate for numStar times
Q: Write a program to input a positive integer and print the sum of its digit (hint: use…
A: Required: Write a program to input a positive integer and print the sum of its digit Required code…
Q: Write a program that will ask the user for 7 integers, then print their total. Note: 1. You must use…
A: A required program is as follows, #include <iostream> int main() { //Declare three…
Q: Write a program that uses a while loop to determine how long it takes for an investment to double at…
A: Python program is coded in the next step using the while loop.
Q: Use for loops to construct a program that displays a shape of Xs on the screen. The shape should…
A: Algorithm: 1. Start 2. Read number of rows 3. First outer loop is used to handle number of rows and…
Q: Write a program that receives an integer input from the user and call it n. Use a for loop, an if…
A: According to the information given:- We have to follow the instruction in order to get desired…
Q: 3. Write a program that reads in a sequence of integer inputs between 1 and 100 (using a while loop)…
A: Please find the answer below :
Q: Write a while loop that outputs values 15 to 1. Decrement by 1
A: using System;using System.Collections.Generic;using System.Linq;using System.Text;using…
Q: Write a Python program that will ask the user five (5) times using a WHILE Loop to input the full…
A: Using the while loop a set of statements can be executed for the true condition. Syntax: x = 1while…
Q: Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output with…
A: Start input user_num initialize i=1 run while loop i<=user_num print i stop
Q: Write a program that prints multiples of 9 in descending * order on a single line. * The program…
A: C++ Program for above : #include <iostream> using namespace std; int main() { cout…
Q: at uses a for loop to print all positive even numbers less th
A: Below the C program that uses a for loop to print all positive even numbers less than n(n is a…
Q: python Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output…
A: Here I have first of all asked the user to enter the number Now I have declared another variable…
Q: Write a program using for loop that generates a multiplication table for any integer (given by the…
A: Given :- Write a program using for loop that generates a multiplication table for any integer…
Write a
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- In python, A customer in a store is purchasing items. Write a program, using a while loop, that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total when the customer is done entering all the items. Assume the sales tax is 7 percent. The customer should be allowed to enter as many items as they wish. The while loop should terminate when the user hit the key (Return) on the keyboard. (Hint: Use a null or empty string). Optionally, if you would like to round the dollar amount to two decimal places, you can use output formatting construct in your print statement. For example: print("Sales tax: ", format(sales_tax, '.2f')) will round to two decimal places. Expected Output: Enter the item price or <ENTER> to end: 22.50Enter the item price or <ENTER> to end: 1.99Enter the item price or <ENTER> to end: 45.30Enter the item price or <ENTER> to end: 70Enter the item price or <ENTER> to end: 5Enter the item…USING FOR LOOP1. Create a program that can print 1to 50 .2. Create a program that can print 50-13. Print your name 10 times4. Print the output using for loop: 2 4 6 8 10 12 14 16 18 205. Print the output using for loop: 3 6 9 12 15 18 21Write a program Digits that prompts the user to input a positive integer and then outputs the number reversed and the sum of the digits. For example, if the user enters the number 3456, then your program should output 6543 and the sum as 18. Use a while loop. EXAMPLE OUTPUT: Enter an integer: 3478246 Number reversed: 6428743 Sum of digits: 34 You may assume the user enters a number smaller than the max int (2,147,483,647).
- Write a program that requests the current time and a waiting time as two integers for the number of hours and the number of minutes to wait. The program then outputs what the time will be after the waiting period. Use 24-hour notation for the times. Include a loop that lets the user repeat this calculation for additional input values until the user says she or he wants to end the program. Input Notes:Both the current time and the waiting time are entered in the form HH:MM where HH and MM are integers signifying hours and minutes respectively. In response to the continuation prompts (described below) the user types a y or a Y to signify "continue" with any other character signifying "quit". Output Notes (Prompts and Labels):At the outset the program prints the title "Compute completion time from current time and waiting period". The program then prompts for the current time with the prompt "Current time:" followed by the instructions "Enter 24 hour time in the format HH:MM". After…Write a program using while loop. You should ask a user to enter a number as an input and in each loop iteration, divide the number by 2, then print the numbers. While loop should repeat as long as the number each step is greater than or equal to 1.. Sample output with input: 30 20.0 10.0 5 2.5 1.25 0.625Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score (display the student’s name and score). Also calculate the average score and indicate by how much the highest score differs from the average. Use a for loop. Test Data: Ben Simmons 70 Carson Wentz 80 Joel Embiid 90 Bryce Harper 75 Redo Problem A. Replace the for loop with a while loop
- Write a program that generates a random number and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” The program should use a loop that repeats until the user correctly guesses the random number.Write 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.Write a complete program that: 1. Uses a do...while loop to prompt the user to enter a count that is greater than 1 and less than or equal to 20 then reads in a count from the keyboard as an integer. a. If input error occurs or the count the user enters is less than or equal to 1 or greater than 20, output an error. After outputting an error, clear/ignore the failed input and continue do...while looping until a valid number is entered. 2. Writes a triangle to the display using for loops. The triangle will be upside down. To write this triangle to the display: amountOfStars = number entered in (1). a. b. Output amountOfStars followed by a new line. C. Decrement amountOfStars by one. d. Continue from (b) until amountOfStars is zero. 3. Writes a triangle to the display using while loops. The triangle will be rightside up. To write this triangle to the display: a. amountOfStars = 1. b. Output amountOfStars followed by a new line. C. Increment amountOfStars by one. d. Continue from (b)…
- Write a program to simulate how a for loop works with the range. The input to your program are two integers start and stop. Check that the second integer stop is not less than or equal to the start. If the second integer stop is less than the first start, then see the example output below. Otherwise, (if the stop is less than the start) proceed with the rest of the program. Output the value of the start and keep subsequently incrementing it by 5 as long as the value is less than the stop. Input (1) : 20 5 --> the output is: There won't be any output sequence if the second integer is less than or the same as the first. input (2) :-15 10 the output is: -15 -10 -5 0 5 Use the if/else statements to run a preliminary check of the input before taking other actions Use the print() statement inside the loop Provide the end argument to the print() to correctly generate the output sequenceWrite some code that uses a while loop to get 10 integers from the user, one at a time. When all integers have been entered, print the highest number. Example input/output (user input shown in blue) Enter an integer: 1Enter an integer: -2Enter an integer: 4Enter an integer: 99Enter an integer: 8Enter an integer: 67Enter an integer: 83Enter an integer: 40Enter an integer: 99Enter an integer: 8The highest number is 99Write a program that reads in numbers from the user and outputs the information specified below. Part One: Get Valid Input Read in two integers from the user: a lower end of a range and an upper end of a range. Check if the numbers are valid (lower cannot be greater than upper). If the numbers are invalid, use a loop to ask for new numbers. Continue looping until you get two valid values. Part Two: Calculate the Sum Use a loop to calculate the sum of all values from lower (inclusive) to upper (inclusive). Output the sum to the user. Part Three: Analyze the Sum Determine if the sum is even or odd. Determine if the sum is positive, negative, or zero. Output this information to the user. Part Four: Calculate the Average Calculate the average of all numbers in the range from lower (inclusive) to upper (inclusive). Style and Additional Coding Requirements code should compile properly space and indent your code follow Java naming conventions for variables (lower camel case with no…