Design a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.
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 program that asks the user to enter today’s sales for five stores. The program should then…
A: Following is the c++ program that takes as input from user sales of five stores and display the…
Q: Write a program that will correctly lists all factors of an integer entered by the user. The user
A: Algorithm - Step 1 - Start step 2- declare a integer variable n and i , and assign i= 1 step 3- Take…
Q: Using a while loop create a program that will prompt the user for a positive number and then print…
A: Source code (Program) is written in python. Please find the program in Step 2
Q: Using NESTED LOOPS, this program asks the user to enter an integer from 3 to 9 * and prints a…
A: A Java program is as follows, File name: “TriangleProblem3.java” import java.util.Scanner; //Create…
Q: Write a program that asks the user to enter the amount that he or she has budgeted for a month. A…
A: As there is no programming language mentioned so question is attempted in python language. enter…
Q: Using Loops to Solve a Problem Write a program that takes an integer as input and returns whether…
A: PYTHON CODE:- n=int(input("Enter the number: "))c=0a=1b=1if n==0 or n==1: print("Yes")else:…
Q: Demonstrate a do-while loop program that asks the user to enter two numbers. The numbers should be…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Read 2 numbers a and b…
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: Design a program that decides whether students are passing or failing. The program should accept a…
A:
Q: Using Python to write a program with a loop that asks the user to enter a series of positive…
A: Algorithm: Start Initialize total to 0 Iterate through the loop Ask user to enter a number If…
Q: esign pseudocode for a program that accepts numbers from the user until the special number hits 30…
A: We have to design pseudocode for a program that accepts numbers from the user until the special…
Q: Write a program that will correctly lists all factors of an integer entered by the user. The user…
A: Dear Student, As no programming language is mentioned I am doing it in c++.
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: Design a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit…
A: Program plan:Use “for” loop to print a table of the Celsius temperatures 0 through 20 and their…
Q: Write a program that asks the user to enter a word. The program will then display the word for as…
A: SUMMARY: - Hence, we discussed all the points.
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 generates a random number between 1 and 100 and asks the user to guess what the…
A: Lets see the solution.
Q: Design a Do-While loop that asks the user to enter two numbers. The numbers should be added and the…
A: PROGRAM CODE: #include <iostream> using namespace std; int main(){ //declare variables…
Q: Write pseudocode OR Python code that contains a While loop that asks the user to enter a number. The…
A: Given: Python code that contains a While loop that asks the user to enter a number. The loop should…
Q: Write a program that uses a while loop to enable the user to enter any number of positive integers.…
A: According to the question below the solution: Programming language is not mention so i am using…
Q: Write a program that asks the user for a starting value and an ending value and then writes all the…
A: The while loop in the program iterate through all the values between s and e. The complete program…
Q: Write a program that generates a random number and asks the user to guess what the number is. If the…
A: Given: Write a program that generates a random number and asks the user to guess what the number is.…
Q: Design a VI in LabVIEW to display the sum of first 'n' numbers using for loop, e.g., if user enters…
A: here in this question we will develop program which will accept number from user and then it will…
Q: Create a program using C++ Goto loop that would ask the user to input a number and to input a range.…
A: Logic: Declare variables. Accept number and range from user. Create label for goto statement.…
Q: Write a program that uses a while loop to do the following: Repeatedly asks the user to enter a…
A: Algorithm: Start READ num IF num !=0 small=large=num while(num!=-1): READ num IF…
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: (-1)"x2n 00 cos(x) = 1- 2! %3D 4! (2n)! n=0 where x is in radians. Write a MATLAB progran that…
A: The use of the Taylor series in computer science, calculus, chemistry, physics, etc helps in…
Q: Write a loop to request integer values until a positive value is entered. Example Output Enter an…
A: Programs: Programs are the instructions given to the computer to perform certain tasks, the…
Q: Write a program that will print the message “Computer Science is cool” 10 times. Use a while loop.…
A: Here in this question we have asked to write a program that will print the message “Computer…
Q: a program that will display the possible positive factors of a positive input integer number.( Do…
A: NOTE: SINCE THE LANGUAGE OF PROGRAM IS NOT MENTIONED, I HAVE USED JAVA FOR CODING Define…
Q: Design a while loop that lets the user enter a number. The number should be multiplied by ten, and…
A: def getnum(): while(until sum is less than 100): input(ask for number) product =…
Q: Write a program segment with a do-while loop that displays whether a user- entered integer is even…
A: Program: #include <iostream>#include <stdlib.h>using namespace std;int main(){int num =…
Q: B. Sum of Numbers Design a program with a loop that asks the user to enter a series of positive…
A: Here, we have to find the sum of numbers entered by a user. The program should take the input until…
Q: Design a While loop that lets the user enter a number. The number should be multiplied by 10, and…
A: Since the Programming language is not mentioned in the question, we will answer this question in…
Q: A country club, which currently charges $2500 per year for membership, has announced it will…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Using Python, write a program with a loop that asks the user to enter a series of negative numbers.…
A: We have to write a Python program to the given set of conditions.
Q: In python, the while loop stops when the condition evaluates to false. Select one: O True O False
A: OPTION 1: TRUE
Q: Description of the Problem Write a program that inputs your student number and printout your…
A: In this code, our goal is to add the details of a student and user enter a student id, check whether…
Q: In python for loop statement step/changing value by default is taken as 1 Select one: O True O False
A: The Python programming language provides a variety of loops to manage connection needs. Python…
Q: Create a flowchart for a guessing game. Arandom number between 1 and 10 is generated. The user…
A: It is a pictorial representation of the flow of program. Symbols: Oval represents start/stop…
Q: Write a loop to print all numbers from 1 to 100, one per line. Write a blank line after every five…
A:
Q: Write a program that inputs the miles driven and the gallons used for multiple trips and displays…
A: Since here no programming language is specified. So, we are providing the program code in C++. The…
Q: Write a program that asks the user to enter today’s sales for five stores. The program should then…
A: To solve this program following variables, data types and methods are used to calculate the sell…
Q: A tennis club , which currently charges $150 per month for membership, has told the members that…
A: #note no programming language is mentioned so i was used c++ programming language…
Q: answer c++ question Write a while loop that will ask the user to enter 10 names
A: THIS IS A MULTIPLE BASED QUESTION. ONLY FIRST PART IS SOLVED. KINDLY SEND THE REMAINING QUESTIONS ON…
Q: Sum of Numbers Problem Design a program in Python with a loop that asks the user to enter a series…
A: CODE:- lst = []while True: x = int(input('Enter a number:')) if x > 0: lst.append(x)…
Q: The instructions in a _____________________ loop might not be processed at all, whereas the…
A: Pretest loop: In a pretest loop, the test condition is evaluated before entering the loop. If the…
Q: Write a complete program that: 1. Uses a do...while loop to prompt the user to enter a count that is…
A: Answer :
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Question#2. The distance a vehicle travels can be calculated as fallout: Distance = Speed * Time For example, if a train travels 60 miles-per-hour for three hours, the distance [raveled is 120 miles. Write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. For example, if a vehicle is traveling at 40 mph far a three-hour time period, it should display a report similar to the one chat follows: Hour Distance Traveled 1 90 2 100 3 150 Input Validation: Do not accept a negative number for speed and do not accept any value les than 1 for time traveled.Chapter 4 Loops and Files 17. Random Number Guessing Game Write a program that generates a random number and asks the user to guess what the num- ber 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 cor rectly guesses the random number.1/ Write a program that reads in a series of integer numbers, and determines how many positive odd numbers are among them. Numbers are read until a negative integer is given. Use DO-Loop with EXIT statement.
- Use C++ programming language.. Random Number Guessing Game Write a program that generates a random number between 1 and 100 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. Then the program should display “Congratulations. You figured out my number.”Q:03: Write a program that finds and displays the sum of positive numbers, if any negative number is entered by the user the loop must end.pow(3,4)=? Select one: O a. 81 O b. 12 c. 64 O d. 7
- Part A: While Loop Program - using Java. Write a program that detects Fibonacci numbers. Prompt the user to input a positive integer. Upon input, the program will determine if the number is either a Fibonacci number or not. If a Fibonacci number, then the order of the number in the sequence must be output. If not a Fibonacci number, then the Fibonacci numbers above and below it (including their order in the sequence) must be output. Once it finishes, the program will prompt the user for a new number. The program will exit if the user enters a non-integer number or string (such as “quit”) instead of an integer. Use the sample output file, fib-seq-det.txt, to view a sample session Additionally: For both the above problems, the first four numbers of the Fibonacci sequence are: 0, 1, 1, and 2. Part A must use While loops onlyMUST BE IN PYTHON PROGRAMMING CODE!!!!! NO C++ or Java!! Directions: Design a program with a loop that lets the user enter a series of names (in no particular order). After the final person’s name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb. Additional requirements: Note that the possible set of input values can include negative, 0, or positive values, but not the sentinel value of -99. DESIGN HINT: • When determining the largest (or smallest) value in a set of numbers, remember to use variables to keep track of the current largest (or smallest) number found thus far. These variables can then be used as a comparison to each subsequent input number to see if the new number is larger (or smaller) than the current largest (or smallest) number and updated appropriately. At the end of all…Write a while loop that will let the user enter a series of integer values and compute the total values and number of values entered. An odd number will stop the loop. Display the number of iterations and the total of the values after the loop terminates. for Loop Write a for loop to display all numbers from 13 - 93 inclusive, ending in 3. Write a for loop to display a string entered by the user backwards. do Loop Write a do .. loop for the random number dice problem from Chap Three. Add a counter variable that is used to count the number of times this code is executed in the loop and stops after 5 times. roll = rand.nextInt(6) + 1; System.out.println(" Roll = " + roll); ctr++; using java
- Basic while loop expression. 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 2 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 160, then with userNum = 8, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks".Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.Problem 2: Safe Square Root Write a program to take the square root of a number typed in by the user. Your program should use a while-loop to ensure that the number they typed in is positive. If the number is negative, you should print out a warning “The number is negative. Try again.” and re-prompt the user to take a valid input. You can get the square root of a number n with Math.sqrt(n). Make sure you don't do this until the loop is done and you know for sure you've got a positive number. Sample input and output: Enter a number > -9 The number is negative. Try again. Enter a number > 9 The square root of 9 is 3.0 Enter a number > 2 The square root of 2 is 1.4142135623730951program using a while loop that lets the user enter a series of integers. The user should enter 10 values and the program will display the two largest numbers. You can only use a number once.