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.
Q: Write a program that takes the user age and prints the following: Print too old, if age is greater…
A: Use if else if statements to check all the conditions one by one
Q: Write a program that prints out the letters of a word, each followed by a dot (full stop or period)…
A: Wrtting the program below with comments :
Q: Write a program to grade students based on scores out of 100 and also print a teacher comment. If…
A: I give the code in Python along with output and code screenshot
Q: Write a program that plays a guessing game with the user. The user should pick a letter, and the…
A: GIVEN: Write a program that plays a guessing game with the user. The user should pick a letter, and…
Q: Write a program that calculates and prints the bill for a cellular telephone company, on the type of…
A: Actually, program is a executable software that runs on a computer.
Q: Write a program that reads in a temperature from the keyboard an- prints what type of shirt is…
A: Please find python code in the following step.
Q: Write a program that asks the user about themselves then prints out a summary like this: What colour…
A: The program is written in Python. Check the program screenshot for the correct indentation. Please…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: First, figure out how we want to represent the data on the computer: Data Representation: Represent…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: We need to read a string and compare the string with list of favorite food.
Q: Write a program that reads the price and the production date(month and year of an item) then prints…
A: import java.util.*;import java.io.*; public class Main{ public static void main(String[] args)throws…
Q: Write a program that will check and print if the person is a regular passenger, student or senior…
A: Program Code: #include<stdio.h>#include<conio.h>main(){ int ch,fare; printf("If you are…
Q: Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and…
A: The given code is in Python.
Q: Write a program that asks the user for a number of seconds and prints out how many minutes and…
A: Program: To asks the user for a number of seconds and print as minutes and seconds format.…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: A required Java program is as follows, File name: “LabProgram.java” import java.util.Scanner; public…
Q: Write a program that simulates flipping a coin twomillions times and displays the number of heads…
A: Program code: //import the required packagesimport java.util.*;//Declare class HeadTailCoinpublic…
Q: Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: Write a program that models 2 vehicles (Car and Truck) and will be able to simulate driving and…
A: This is an object oriented programming concept in which concepts like inheritance, polymorphism are…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: According to the information given:- We have to create the program in that we as user to tell his…
Q: Write a program to take orders for a computer shop and print a bill. Your program asks for the…
A: **THIS CODE IS WRITTEN IN PYTHON SINCE NO PROGRAMMING LANGUAGE WAS MENTIONED. #input values item…
Q: Write a program that gets two car information from the user, compares them, and print out the…
A: First, we need to define Car class with the attributes and methods and then define the main function…
Q: Write a program that computes the rent in five years and the total rent for one year starting five…
A: Program description: Assume, b be a user input integer variable that stores the basic salary. r is a…
Q: Write a program that determines the distance to a lightning strike based onthe time elapsed between…
A: We need to find the distance to the lightning strike based on their time elapsed between the flash…
Q: Write a program that shows the growth of money that occurs in a savings account. Your program should…
A: Program code: #prompt the user to enter initial balance initialBalance=int(input("Enter initial…
Q: Write a program that asks the user to guess a random number between 1 and 10. If they guess right,…
A: Program: # initialize the score to 0 score = 0; # the number to guess is 5 number = 5; # run the…
Q: Write a program that asks the user for a line of text and counts how many spaces, periods, or commas…
A: Since you have not mentioned any language, i will code it in python.
Q: Write a program that takes in user input to ask the following questions: "What is your favorite…
A: The answer is given below.
Q: Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the…
A: Start input age through get_age function if person is not in between 18 to 75 the print message…
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: Distance between two points P1(x1,y1,z1) and P2(x2,y2,z2) = x2-x12+y2-y12+z2-z12 Put all the values…
Q: Write a program that prompts the user to enter the three dimensions, possibly with decimals, of a…
A: //Solution in C++ #include<iostream>#include <iomanip>using namespace std;int main(){…
Q: а. Write a program that calculates and prints the fare for an airline. There are two plans: Plan…
A: Code: #include <cctype> #include <iostream> #include <cstring> #include…
Q: Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height. It…
A: Python code to find BMI of person is given below.
Q: Write a program that reads non-negative integer number and determines whether it is odd or even or…
A: Here we will write a program that reads non-negative integer number and determines whether it is odd…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
Q: Write a program that will figure out the required change for a purchase. Start by asking the user…
A: Introduction of the Program: The Java Program takes the cost of the product and amount paid from the…
Q: Write a program that promotes the user to enter the number of students and each student's name and…
A: The java program and the approach that prompts the user to enter the names and the scores of the…
Q: Write a program that asks the user how many credit units they have taken. If they have taken 23 or…
A: Program Approach: Include the necessary header files for the standard I/O. Declare a user input…
Q: Write a program that will count the number of votes for each candidate, show the total number of…
A: Use an array to store the votes for each candidate and keep on voting till user wish to quit
Q: a program that plays a game with a single die (or dice). Each number on the die is worth a certain…
A: It is defined as Dice (singular die or dice[1]) are small, throwable objects with marked sides that…
Q: Write a program that will Input the name , position of the employee , Input the rate per hour, hours…
A: Program: #include <iostream> using namespace std; int main() { string name; int…
Q: write a program that accepts a number and determines whether the number is positive, negative or a…
A: here in this question we have asked to write a program which takes an input from user and…
Q: Write a program that models 2 vehicles (Car and Truck) and will be able to simulate driving and…
A: GIVEN Write a program that models 2 vehicles (Car and Truck) and will be able to simulate driving…
Q: Write a program that prompts the user to enter apoint (x, y) and checks whether the point is within…
A: Program Approach: Importing necessary packages to get standard input and output. Defining a class…
Q: Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and…
A: Given Code : integral_calc = float(input('Input your grade in Integral Calculus: '))phys =…
Q: Write a program that allows you to play rock,paper, scissors against the computer. When first run…
A: #include <iostream>#include <stdio.h>#include <stdlib.h>#include <ctime>…
Q: Write a program to read two integers, then test if the two numbers are divisible by (5,6) at the…
A: Write a program to input two numbers and check if both are divisible by 5 and 6 at the same time
Q: Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per…
A: Note: In this question the coding language is not specified then we are doing this question in the…
Q: Write a program that asks the number of students and then asks to enter the student's mark and then…
A: As the programming language is not mentioned, we are using PYTHON here The code and output…
Q: Write a program that helps the user count his change. The program should ask how many quarters the…
A: Java program is asked for the given requirements.
Q: Write a program that asks the user for an animal sound, then prints out that sound twice on the same…
A: the answer is given below:-
Q: Write a Java program to take orders for a mobile shop and print a bill, Your program asks for the…
A: Required: Write a Java program to take orders for a mobile shop and print a bill, Your program asks…
Write a
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. 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’tdisplay the computer’s choice yet.)2. The user enters his or her choice of “rock,” “paper,” or “scissors” at the keyboard.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Therock smashes the 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. (Paperwraps rock.)• If both players make the same choice, the game must be…Write a program that plays a dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get 21 or as close to 21 without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is declared. Otherwise,…Write a program that plays a dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get 21 or as close to 21 without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is declared. Otherwise,…
- Write a program that recommends the number of calories a person should eat each day. Calories are units of energy found in all foods. Base your recommendation on the person's weight and whether the person has an active or sedentary (inactive) lifestyle. If the person is sedentary, that person's activity factor is 13. If the person is active, that person's activity factor is 15. Multiply the activity factor by the person's weight to get the recommended number of calories. Start your program by: having the user enter their weight, as a floating point number; having the user enter whether they have active or sedentary lifestyle, as a character, 'A' for active or 'S' sedentary; use a switch (or else if) selection statement to use the appropriate calculation for the recommended calories for the selected lifestyle. print out your results on the screen.In this lab work, you will implement a coffee shop example. In this coffee shop, everything must progress as if it does in real life. It means that the program should ask a person for body temperature in Celsius, and grant or reject access to a coffee shop. When a customer orders a coffee, they have to choose a size such as Small, Medium, and Large then, depending on the order, the price has to change. The price also has to change depending on the type of coffee. For example, for coffees that are similar to espresso, you also need to take every shot of espresso into account. The actual prices of the coffees depend on your imagination however, they should be realistic. Some hints: • Focus on dividing your program into multiple functions. • You can also return double or integer types of values from your functions, so use them if you can. • Don't just code a function every possible type of, and try to make it generic as much as possible. • Be creative. Fill the gaps using your…Write a program that asks the user how many credit units they have taken. If they have taken 23 or less, print that the student is a freshman. If they have taken between 24 and 53, print that they are a sophomore. The range for juniors is 54 to 83, and for seniors it is 84 and over.
- Write a program that plays a game with a single die (or dice). Each number on the die is worth a certain number of points. If the person rolls a six, then that roll is worth 4 points. If the person rolls a five, then that roll is worth 3 points. If the person rolls a three, then that roll is worth 2 points. All the other rolls (four, two or one), that roll is worth 1 point. The rules of the game is that the player rolls the die five times, and adds them up. If the total adds up to a number greater than or equal to 15, then the player gets a rating of excellent. If the total adds up to a number greater than or equal to 12 but less than 15, then the player gets a rating of above average. If the total adds up to a number greater than or equal to 7 but less than 12, then the player gets a rating of good. If the total adds up to a number less than 7, then the player gets a rating of poor. After the game is over, the program should ask the user if they want to play again. In…Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 5.1. 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. 5.2. The user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. Gather this input using JOptionPane.showInputDialog(). 5.3. Display the computer’s choice. 5.4. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins. Display something to the effect of: “Rock smashes the scissors.” If one player chooses scissors and the other player chooses paper, then scissors wins. Display something like: “Scissors cuts paper.” If one player chooses paper and the other…Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 5.1. 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. 5.2. The user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. Gather this input using JOptionPane.showInputDialog(). 5.3. Display the computer’s choice. 5.4. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins.Display something to the effect of: “Rock smashes the scissors.” If one player chooses scissors and the other player chooses paper, then scissors wins.Display something like: “Scissors cuts paper.” If one player chooses paper and the other player…
- Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your classes and your friends and to ask for money; you might write to a friend about your love life, your classes, and your hobbies; and you might write to your brother about your hobbies and your friends and to ask for money. Write a program that prints similar letters such as these to three people of your choice. Each letter should have at least one paragraph in common with each of the other letters. Your main program should have three method calls, one for each of the people to whom you are writing. Try to isolate repeated tasks into methods.Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000. Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000. Prompt the user to enter the following information: Marital status If the marital status is “married,” ask for the number of children under the age of 14 Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.) Percentage of gross income contributed to a pension fund Your program must consist of at least the following functions: Function getData: This function asks the user to…Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%. Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000. Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000. Prompt the user to enter the following information: Marital status If the marital status is “married,” ask for the number of children under the age of 14 Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.) Percentage of gross income contributed to a pension fund