Programming Problem 1Write a program that has the user input their height in inches and convert it to meters. Print the inches and the converted meters. The program should allow the user to enter as many heights as they want (use a loop for this).
Q: Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print…
A: The problem is based on the basics of loops in python programming language.
Q: Loops, C++ Write a program that takes in a line of text as input, and outputs that line of text in…
A: 1. Taking a variable text of string type. 2. declaring i variable for iterations. 3. getline is used…
Q: Converting pounds into kilograms Write a program that converts pounds into kilograms. The program…
A: Algorithm - Take Input User. Add the logic to convert pounds to kg.\ kilograms = pounds *…
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: Q2: Write a program that reads in a series of integer numbers, and determines how many positive odd…
A: Step-1: StartStep-2: Declare an arraylist list of integersStep-3: Declare two integer variable n and…
Q: You want to determine the amount you will save for a down payment on a home in the next 3-7 years.…
A: Since programming language was not mentioned , So I chosen PYTHON PROGRAMMING…
Q: Exercise 2: Write a program that uses input to prompt a user for their name and then welcomes them.…
A: Explanation: You did not mention programming language so I did this program using c,c++, java, and…
Q: Problem Description: Write a program that displays all the numbers from 100 to 1,000 -ten per line-…
A: Program: import java.util.*; import java.lang.*; public class Main { public static void…
Q: Write a program that accepts 10 integers form the user and then displays the sum of numbers which…
A: Actually, program is a executable software that runs on a computer.
Q: (Compute expressions) Write a program that displays the result of 7.5 x 6.5 - 4.5 x 3…
A: Since the Programming language is not mentioned in the question, we will answer this question in…
Q: Question 1 Write a program that finds the new salary of an employee after several years of work…
A: Note: Programming language not mentioned in the question. C++ is chosen for implementation.…
Q: Design a program that decides whether students are passing or failing. The program should accept a…
A:
Q: There are 6 employees. Write a program with nested loops, to ask the yearly salary of each employee…
A: In this program, you need to take user input for salary of 6 employees for 5 years. After taking…
Q: Homework 1. Write a program to have the user guess a number stored in the program. If he guesses…
A: According to the question below the complete program: Programming language is not mention so i am…
Q: Write a program using a Loop structure that takes Five inputs of sales for item 1 – item 5 from the…
A: code snippet:
Q: Write a program using a Loop structure that takes 5 inputs of sales for item 1 – item 5 from the…
A: Program: import sys sales=[] subtotal = 0 # Assign subtotal with 0 totalSales = 0 # Assign…
Q: Create a program that user input 7 numbers that will display the lowest number to highest numbers…
A: Given:
Q: Programming Language: Python Topic: LOOPING 2. Write a program that will display the following…
A: 1) Below is program that will display the "*"pattern, given the value of n Ask user to enter value…
Q: Write a program take will take in two numbers from the user and produce the quotient and remainder…
A: As there is no programming language is mentioned so I will solve this question using programming…
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: Seasons Write a program that takes a date as input and outputs the date's season. The input is a…
A: Start Takes the value of month as input. Takes the value of date from the user. If month is march…
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: Using Flowgorithm, create a program that outputs numbers in ascending and descending order. The…
A: Solution is in Step 2.
Q: Write a program that asks the user to enter the number of courses he/she is taking and then enter…
A: #include <iostream> using namespace std; int main() // main function { int n; //…
Q: Given the sample code above in generating a random number. Create a program that lets the user play…
A: Code: #include <iostream> using namespace std; int main(){ //declare variableint userChoice,…
Q: Write a program that uses aa loop to display a table of the Celcius temperatures from 0 to 30 and…
A: #include<iostream> using namespace std; int main(){ //displaying the heading cout…
Q: The distance a vehicle travels can be calculated as follows: distance = speed * time. For example,…
A: Write a C++ program that asks the user to enter the speed of a vehicle(in miles per hour) and how…
Q: Write a program that uses nested loops to collect data and calculate the average rainfall over a…
A: #include<iostream> using namespace std; int main(){ int numberOfYears=0, totalRainfall=0;…
Q: Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part E…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Initialize total to 0…
Q: Modify one of the grades dictionaries form program #3 and make yours: Boudalia = { "name":…
A: Required:
Q: C++ problem: Write a program that uses while loops to perform the following steps: a. prompt the…
A: Program description : The main.cpp C++ program prompts user to enter the values for firstNum and…
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: In many sports events, contestants are rated by judges with an average score being determined by…
A: PROGRAM INTRODUCTION: Declare and initialize a variable to store the sum of the scores. Start the…
Q: 9. Write a program which asks the user for their score on the exam. Display their letter grade based…
A: Ans: Code: grad = input('Grad> ') if grad >= 90 fprintf('A'); elseif grad >= 80…
Q: Write a program that prompts the user to input three numbers. The program should then output the…
A: Java program to display the three number in ascending order. Create the object of the Scanner class…
Q: Seasons Write a program that takes a date as input and outputs the date's season. The input is a…
A: Approach - Take input from the user in as string and int. Use if-else conditional statements to…
Q: [Problem description] Write a program that reads an unspecified number of integer s, and print the…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: Write a program that displays a weekly payroll report. A loop in the program should ask the user for…
A: Answer: The program has shown below- #include<iostream> #include<stdlib.h> using…
Q: 1. Write a program that calculates the squares and cubes of the index values from 0 to 10.…
A: #include<iostream> // it is "iostream" is C++ standard library which helps to implement stream…
Q: Given the sample code above in generating a random number. Create a program that lets the user play…
A: According to the information given:- We have to create rock paper and scissor game on the basic of…
Q: a program that asks the user to enter the amount that he or she has budgeted for a month. A loop…
A: Python is a powerful general-purpose programming language. It is used in web development, data…
Q: Exercise 3 (Loop) for 0sx<15 for 1.5 sx <3.0 x+ 3x +2 f(x) = {x-4+ Vx+1 2x+5 for 3s x<5.0 Iog (x+1)…
A: The conditions given are:- If long x = 0 to x = 5.0 define xi i = 1, 2, 3, ....., N. dx = distance…
Q: A function declared int addition (int a and b) is capable of returning one value back to the main…
A: Answer: Given function declaration is : int addition (int a and b)
Q: Write a program that will print the message “Computer Science is cool!!” 10 times. Use a while loop.…
A: Solution :
Q: 26.Temperature Conversion Write a program which prompts the user for a Fahrenheit temperature,…
A: note: since you have not mentioned your preferred programming language. I have attempted it in…
Q: Design a program that asks the user to enter the amount that he or she has budgeted for a month. A…
A: Required: Design a program that asks the user to enter the amount that he or she has budgeted…
Q: distance = speed time For example, if a train travels 40 miles per hour for 3 hours, the distance…
A: Code: #include<iostream>using namespace std;int main(){int s,h,d;cout<<"What is the…
Q: 5- Write a program that asks the user to enter an angle in degrees and prints out the sine of that…
A: Coded using C++.
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.
Write a program that has the user input their height in inches and convert it to meters. Print the inches and the converted meters. The program should allow the user to enter as many heights as they want (use a loop for this).
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- 6. Distance Traveled The distance a vehicle travels can be calculated as follows: distance = speed time For example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. The program should then use a loop to display the distance the vehicle has traveled for each hour of that time period. Here is an example of the output: What is the speed of the vehicle in mph? 40 How many hours has it traveled? 3 Hour Distance Traveled 1 40 2 80 3 120 Input Validation: Do not accept a negative number for speed and do not accept any value less than 1 for time traveled.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.”No written by hand solution IN JAVA - NEEDS DRIVER AND CLASS PROGRAM Average Rainfall Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month.
- 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.1. Write a program that lets the user guess whether a randomly generated integer would be even or odd. The program randomly generates an integer and divides it by 2. The integer is even if the remainder is 0, otherwise odd. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.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 only
- //PROBLEM 1/* This program should play a game with the user asking her to guess a target number (randomly generated integer between 1 and 10). The user gets 3 attempts. If she gets it wrong, the program tells her to go up or down, depending on whether her number was less or more then the target. The output may look like this, for example: ============= Guess the number between 1 and 10 in THREE attempts. Enter your first guess: 4 Nope. Go up. Enter your second guess: 6 Nope. Go down. Enter your third and final guess: 5 You got it! CONGRATULATIONS! ============= or like this: ============= Guess the number between 1 and 10 in THREE attempts. Enter your first guess: 4 Nope. Go up. Enter your second guess: 6 Nope. Go up. Enter your third and final guess: 8 GAME OVER! You lost! The number was 9MUST 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…a. A bowling team consists of five players. Each player bowls three games. Write a program that uses a nested loop to enter each player's individual scores and then computes and displays the average score for each bowler. Assume that each bowler has the following scores. Use two different loop structures for outer loop and inner loop. For example, if you use "for" as the outer loop structure, the inner loop should be "while" or "do.... while". 1st bowler: 286 2nd bowler: 212 3rd bowler: 252 232 4th bowler: 192 201 265 215 216 235 5th bowler: 186 252 186 236 272 b. Modify the program written for Exercise 3a to calculate and display the average team score. (Hint: Use a second variable to store the total of all the players' scores.)
- The distance a vehicle travels can be calculated as follows:distance = speed * time. For example, if a train travels 40miles per hour for 3 hours, the distance traveled is 120 miles.Write a program that asks the user for the speed of a vehicle(in miles per hour) and how many hours it has traveled. Theprogram should then use a loop to display the distance thevehicle has traveled for each hour of that time period. c++ codeThe distance a vehicle travels can be calculated as follows: Distance = Speed X TimeDesign a program that asks a user for the speed of a vehicle in miles per hour and how many hours it has travelled (Assume the two values are integers). Your program should then use a loop to display the distance the vehicle has traveled for each hour of that time period. (For example, entering 50 mph and 4 hours should produce output like: Hour 1: 50 miles, Hour 2: 100 miles, Hour 3: 150 miles, Hour 4: 200 miles. )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.