Instructions An object's momentum is its mass multiplied by its velocity. Write a program that accepts an object's mass (in kilograms) and velocity (in meters per second) as inputs, and then outputs its momentum. Below is an example of the progam input and output: Mass: 5 Velocity: 2.5 The object's momentum is 12.5
Q: Draw a structured flowchart or write pseudocode that describes the process of guessing a number…
A: The problem is related to guessing the number that will be generated randomly by the program. The…
Q: Write a C program to calculate the area of a circle when the diameter is given. Identify and display…
A: start input diameter of circle calculate radius calculate area=3.15*r*r if area>50 then circle is…
Q: Python Code: Many people keep time using a 24-hour clock (11 is 11 AM and 23 is 11 PM, 0 is…
A: given: Many people keep time using a 24-hour clock (11 is 11 AM and 23 is 11 PM, 0 is midnight). If…
Q: A program tests an input temperature and display corresponding output based on the following…
A: Test an input temperature and display corresponding output.
Q: SAMPLE OUTPUT: A Simple Calculator Program Enter an expression: 4 + 5 Answer: 9 Try Again? [Y/N]: y…
A: Python: Python is a high level, object oriented programming language. Python uses indentation…
Q: Design a program that computes pay for employees. Allow a user to continuously input employees'…
A:
Q: What is required is to write a calculator program that calculates the operations of the square root,…
A: C++ program for Calculator: #include<iostream> #include<math.h> using namespace std; int…
Q: Python Programming The Fibonacci sequence starts 1, 1, 2, 3, 5, 8, . ... Each number in the…
A: Fibonacci Numbers : The Fibonacci numbers are the numbers in the following integer sequence : 0 , 1…
Q: Write a program that inputs year and month number, it then display the number of days in that month…
A: The given problem is to be solved in programming language where the user will input the year and…
Q: The program takes the masses of two objects and the distance between them to determine the…
A: The program takes the masses of two objects and the distance between them to determine the…
Q: 1. Write an Algorithm and Flowchart for the following Ask the user to give input coordinates (x, y)…
A: #include < stdio.h > #include < math.h > int main() { float cx, cy,…
Q: b. Convert the Raptor flowchart to a complete Java program. Start "Input the first number:" GET numl…
A: Step 1: Prompt and accept the first number. Step 2: Prompt and accept the second number. Step 3:…
Q: Write the pseudocode on a piece of paper and explain your answer. 1. Write the pseudocode to…
A: Required: Write the pseudocode on a piece of paper and explain your answer. 1. Write the pseudocode…
Q: SAMPLE INPUT/OUTPUT Write a Java program that will ask the user for the number of rooms (including…
A: The program is written in Java import java.util.*;import java.text.*;public class Main{ public…
Q: *Code in Python* Write a program that takes as input a number of kilometers and prints the…
A: k = float(input("Enter the number of kilometers: "))#1 km = 0.539957 nautical milesnm = k *…
Q: Suppose you deposit $50 in a bank account every month for a year. Every month after the deposit has…
A: I give the code in Matlab as per your requirement along with output and code screenshot
Q: Design a program that will determine how much money you need each month to pay for keeping the car •…
A: The given problem is to be solved in two phases: 1) Creation of flowchart for solution 2)…
Q: In physics, an object that is in motion is said to have kinetic energy. The foll formula can be used…
A: - We need to highlight the code for the required calculation. - We are using C++ here.
Q: 4. Write a Phyton program that computes the speed of sound (a) in air of a given temperature T(°F).…
A: Declare the variable T and Get the Integer input from the user Declare the variable num and…
Q: Samantha and Vikas are looking to buy a house in a new development. After looking at various models,…
A: Programming language is missing in the question. So we will answer this program in C++ language. If…
Q: Write a pseudocode that directs a cashier how to give change. The program has two inputs: the amount…
A: - The question wants to have the code for the currency exchange program.
Q: Write the algorithm and a program that prompts the user to input the masses of the bodies and the…
A: 1. Input the masses of the two bodies and the distance between them. 2. Calculate the force between…
Q: Quiz 2 Draw a flowchart and write a java program that asks the user to enter his\ her grade. The…
A: Program Approach: Importing necessary package Defining the main class Defining the main method…
Q: Write and test a program that computes the area of a circle. Request a number representing a radius…
A: Code: in c++ as no coding language is mentioned: #include <iostream> using namespace std; int…
Q: Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time…
A: Note: As no language is mentioned, therefore answering the given question in python. Input : age…
Q: Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and…
A: you does not mention programming language so we are giving solution in C++
Q: Design and write a Python program that gives and grades a math quiz. The quiz will give 2 problems…
A: Code:- import randomscore=0for x in range(2): n = random.randint(1,20) m =…
Q: C program based on the algorithm below Welcome to the temperature conversion program. Please…
A: PROGRAM: //Header files #include <string.h> #include <stdio.h> //Defining the main int…
Q: if characters ‘Y’, ‘R’ and ‘B’ represents the primary colors Yellow, Red and Blue; this algorithm…
A: if characters ‘Y’, ‘R’ and ‘B’ represents the primary colors Yellow, Red and Blue; this algorithm…
Q: Review Loops Write a java program to ask three people three questions about name, number of courses,…
A: import java.util.Scanner; //Importing Scanner class to take input from the userpublic class Main…
Q: A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose that…
A: Since you are not mentioning the programming language, here we are using C++ to complete the…
Q: 1. Write a program that converts miles to feet. If the distance is more than 15,000 feet, tell the…
A: C program to solve the given problem is below.
Q: You decide to buy some stocks for a certain price and then sell them at another price. Write a…
A: Write a program that determines whether or not the transaction was profitable. If your transaction…
Q: flowchart of Many treadmills output the speed of the treadmill in miles per hour (mph) on the…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Read value in mph…
Q: Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record…
A: Take input of number of new and old videos, compute total price and display. New video price $3.00/…
Q: Write a Little Computer Man program that determines if the number entered by a user is an odd or…
A: Process: A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use…
Q: "A program is designed to calculate the tax to be paid. The program takes the salary as an input in…
A: Solution:-- 1)As it has been given in the question that a program is designed to calculate…
Q: Write a program that converts numbers to words.
A: EXPLANATION - Firstly take input from user a number . Store it into a variable . Create while loop…
Q: A palindrome is a word or a phrase that is the same when read both forward and backward. Examples…
A: Python program to check whether the given word is palindrome or not In a function, first, compare…
Q: Instruction: Write a Java program and make a drawing of the flowchart (make sure to use proper…
A: PROGRAM EXPLANATION: Import the scanner class. Create the main class. Define the main method.…
Q: Input in a number representing a car type, until the number 0 is input. There are three types of…
A: Here we need to write pseudo code. Pseudo code is like code which doesn't need to be error free. It…
Q: The flight of a model rocket can be modeled as follows. During the first 0.15 s the rocket is…
A: Given: Mass of the rocket: Not given, so, I have taken 0.1 Propulsion during the first 0.15s is: 16N…
Q: Write the program that computes an employees pay. The program should input the number of hours…
A: As there is no programming language mentioned so question is attempted in python language In…
Q: 1. For this problem, you are going to design a game for the children to teach them about numbers.…
A: Approach is to take input to number in an infinite loop and when user inputs an even number break…
Q: Write a program that prompts the user to input their names and age and then displays your name and…
A: I have given an answer in step 2.
Q: The following program prints out several numbers. What is the first and what is the last number it…
A: Find the first and last number in the output after execution of the given python program. number =…
Q: speed=input("Enter your speed in mph: ") speed = int(speed) distance = input("Enter your distance in…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: C ++ Demonstration: Write a program that prompts the user to input three positive angle values in…
A: I have provided C++ CODE along with CODE SCREENSHOT and 4 OUTPUT SCREENSHOTS-------------
Q: esign Pseudocode for a program that outputs every number from 1 through 15, the values times 10 and…
A: The given problem is related to algorithm and solving the problem using an algoritham. The program…
Python coding
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Write a program that can suggest an activity based on the temperature. If the temperature is between 20 to 40 degrees Fahrenheit, suggest the user go skiing; if the temperature is between 41 to 60 degrees Fahrenheit, suggest the user go hiking; if the temperature is in the range of 61 to 80, suggest swimming. For all the temperatures out of these ranges (too cold or too hot), then suggest staying inside.Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both single words. Then the program outputs last name, first name. End with newline. Example output if the input is: Maya Jones Jones, MayaA robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move randomly in any of the directions: up, down, left, right. The robot can only move one step at a time. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print “Back to the origin!” to the console and stop the program. If it reaches the boundary of the grid, print “Hit the boundary!” to the console and stop the program. A successful run of your code may look like: Down (0,-1) Down (0,-2) Up (0,-1) Left (-1,-1) Left (-2,-1) Up (-2,0) Left (-3,0) Left (-4,0) Left (-5,0) Hit the boundary! or Left (-1,0) Down (-1,-1) Right (0,-1) Up (0,0) Back to the origin! Instructions: This program is to give you practice using the control flow, the random number generator, and output formatting. You may not use stdafx.h. Include header comments. Include <iomanip> to format your output. Name…
- Write a program called p3.py that prints out a classic hangman stick figure. The program should ask the user to enter a number from 1-6 and the corresponding hangman should be printed. The value the user inputs corresponds to the number of incorrect guesses in a real hangman game and so the completeness of the hangman will correspond to the number of ‘incorrect guesses’ inputted by the user (e.g., if the user enters 1, then only the head of the hangman will be printed; full example below). Example:Enter a number from 1-6: 1O Enter a number from 1-6: 2O|Enter a number from 1-6: 3O\||Enter a number from 1-6: 4O\|/|Enter a number from 1-6: 5O\|/|/Enter a number from 1-6: 6O\|/|/ \FeelWrite a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives. Order Volume Discount Rate >= 200 bags 25% off 120 - 199 bags 20% off 60 - 119 bags 15% off 40 -59 bags 10% off 20 – 39 bags 5.5% off 0-19 bags No discount (1) Inyourprogram,definevariableswithmeaningfulnamestoacceptuserinputonordervolume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table. (2) Yourprogramshouldprintoutuserordervolume,discountrate,andtotalorderingcostinconsole (similar to the following sample outputs)Write a program that inputs a number and checks whether it is a perfect number or not. A perfect number is the number that is numerically equal to the sum of its divisors. For example, 6 is a perfect number because the divisors of 6 are 1, 2, 3 and 1+2+3=6
- Write a program that generates 1,000 lowercase letters randomly, counts the occurrence of each letter, and displays a histogram for the occurrences, as shown in Figure 10.16a.Suppose that the first number of a sequence is x, where x is an integer. Define a0= x; an+1=an/2 if an is even; an+1= 3*an +1 if an is odd. Then there exists an integer K such that ak=1. Write a Program that prompts the user to input the value of x. The program outputs the integer K such that ak=1 and the numbers a0, a1, a2,……….., ak.. (For example, if x=75, then K=14, and the numbers a0, a1, a2,……….., a14, respectively, are 75,226,113,340,170,85,256,128,64,32,16,8,4,2,1. ) Enhance your program from part a by outputting the position of the largest number and the largest number of the sequence a0, a1, a2,……….., ak.. (For example, the largest number of the sequence 75,226,113,340,170,85,256,128,64,32,16,8,4,2,1 is 340 and its position is 4. )Write a program that implements a tip calculator. Your program should ask the user for the bill amount and the percentage of the tip, and then output the dollar amount of the tip and the final bill in three different formats. (see sample below) Example: Enter the bill amount: 27.95 Enter tip percentage: 17 A 17.0% tip on $27.95 equals $4.7515. The total bill is: 32.701499999999996 The total bill is $32.7. The total bill is $32.70.
- A python program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows: When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the computer’s choice yet.) The user enters his or her choice of “rock,” “paper,” or “scissors” at the keyboard. The computer’s choice is displayed. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.) If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.) If one player chooses paper and the other player chooses rock, then paper wins. (Paper wraps rock.) If both players make the same choice, the game must be played…Write a program that reads an integer age of kids, finds the maximum of them, and counts its occurances, finds the minimum of them, and counts its occurances. And Find the average ages. Assum that the input ends with number -1.Write a program that reads a mile in a double valuefrom the console, converts it to kilometers, and displays the result. The formulafor the conversion is as follows:1 mile = 1.6 kilometersHere is a sample run:learn from examplesEnter miles: 96 [ENTER]96 miles is 153.6 kilometers