Write a program that simulates the normal operation of a modern elevator with 25 floors (levels) and that has two buttons: UP and DOWN, except on the lower floor (level), that there is only a call button to UP and the last floor (level) that only exists DOWN button
Q: write a program that displays, in ascending order,the first names of those students who have…
A: Step 1:- In the question does not show in which language write the program therefor above program…
Q: Write a program that accepts a number of minutes and converts it both to hours and days. For…
A: As no programming language is mentioned it is solved using basic C++
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 that asks the user for a word, then prints out the word once on the first line,…
A: Algorithm: Input word from user Append a space to the input word Iterate a for loop for variable i…
Q: Write a program to implement seat booking system for a movie theater. Suppose this movie theater has…
A: Program Plan:- Initialise all the required header files. Declare the total 80 seats in a 2 D array…
Q: Write a program that calculates the reactions of a cantilever bearing a triangular bearing, taking…
A: A stiff structural member that is supported at one end and free at the other is known as a…
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 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 simulates car racing, as shown in Figure 9.29b–d. The car moves from left to…
A: Racing car: Write a program that simulates racing* The automobile moves from left to right. once it…
Q: ncreme
A: The program provided below calculates flame theoretical temperature when a mixture of methane,…
Q: dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as…
A: Q. Write a program that plays a dice game called "21"
Q: Write a program that resembles a phone book, which stores and displays the names, the addresses…
A: Step 1: Declare a structure PhoneBook that stores the name, address and phone number. Step 2: Define…
Q: Write a program that asks the user for his name and salutes him using it. The prompt must be "What…
A: According to the Question below the solution: Output:
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 finds the first unmatched closing bracket which either does not have an opening…
A: Python programming is a high-level interpreted programming language, It's also used to build…
Q: Write a program that calculates the amount of money a person would earn over a period of time if his…
A: here in given question ask for python program.
Q: Write a program that prompts the user to input the height and the radius of the base of a cylinder,…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: #include <iostream>using namespace std; int main() { int hours=0,wage=0; double…
Q: Write a program that can be used by MG-Train to purchase tickets. The train has three cars. Car #1…
A: Answer :
Q: Write a complete interactive CSharp program that prompts the user for the volume and height of the…
A: Using Cylinder Volume formula we can find the radius and twice of this radius is diameter Using…
Q: Write a program that simulates a snail trying to crawl up a building of height 6 steps. The snail…
A: Actually, given information. Write a program that simulates a snail trying to crawl up a building of…
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 can suggest an activity based on the temperature. If the temperature is between…
A: Hi. As you have not mentioned any programming language, I will choose Python. Let's move on to…
Q: Write a program that receives a number from a user and checks if it's float or integer. In case of…
A: First we declare the number variable, which gets input from the user. Also, we declare a variable…
Q: Write a program that produces a triangular grid of numbers as a seating chart (start at 1 in the top…
A: Given:
Q: Write a program that reads the length and width of a rectangle as integers from the keyboard and…
A: Given: We are given a program that reads input as length and width of a rectangle as integers.…
Q: Write a program FirstToFive that simulates a head-to-head match where two players, Daniel and…
A: I have provided JAVA CODE along with CODE SCREENSHOT and TWO OUTPUT…
Q: Write a program that calculates and prints the bill for a cellular telephone company. The company…
A: C++ Code: #include <iostream>#include <iomanip> using namespace std;int main(){ int…
Q: Write a program that allows the user to input the r- and y-coordinates of two squares, and then…
A: Sample Response: #python function to check whether suqares are in a grid. If yes, then check whether…
Q: Write a program that begins by reading a temperature from the user in degrees Celsius. Then your…
A: Given: To Write a program that begins by reading a temperature from the user in degrees Celsius.…
Q: Write a program that works out whether if a given year is a leap year. A normal year has 365 days,…
A: As no programming language is mentioned, it is solved using basic C++
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 plays an A note (440 Hz) for 1 second when a motion sensor detects motion.
A: Lets see the solution in the next steps
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: Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the…
A: Q. Write a program that plays a dice game called "21" It is a variation on BlackJack where one…
Q: Write a program that computes the fare on the Copenhagen Transit system given two inputs from the…
A: The fare on Copenhagen Transit is specified as follows:If the zone is 2 or smaller and the ticket…
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 reads a number in feet, converts it to meters, and displays the result. One…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: . Write a program that computes the theoretical flame temperature when a mixture of methane,…
A: This program provided below calculates flame theoretical temperature when a mixture of methane,…
Q: Write a program that asks users when their birthday is. Use information provided to give them their…
A: Your solution is here with an output.
Q: Write a program that displays a new larger circle with a left mouse click and removes the largest…
A: Below is the python program for the same:
Q: Write a program that simulates picking a card from a deck of 52 cards. Your program should display…
A: JAVA Program: public class Main { public static void main(String[] args) { int card = (int)…
Q: Write a program that simulates flipping a coin one million times and displays the number of heads…
A: Code: public class CoinFlip { public static void main(String[] args) { int heads = 0; int…
Q: Write a program in python to set a same dice on the face every time when the dice is rolled and…
A: Required:- Write a program in python to set the same dice on the face every time when the dice is…
Q: Write a program that simulates the normal operation of a modern elevator with 25 floors (levels) and…
A: Algorithm: Start the program. Read the current floor from user. Read the option from user to move…
Q: Write a program to find two points that are nearest to each other. For example, points (1, 1) and…
A: I have added the comments. I have also added the screenshot. The class name is Test. So the commands…
Write a program that simulates the normal operation of a modern elevator with 25 floors (levels) and that has two buttons: UP and DOWN, except on the lower floor (level), that there is only a call button to UP and the last floor (level) that only exists DOWN button
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write a program that computes the theoretical flame temperature when a mixture of methane, propane, n-butane, and n-pentane (0% to 100% mole methane in 5 % increments; 0 to 100 mol% propane in 5% increments; 0% to 100% mole n-butane in 5 % increments) at 25°C is burned with excess air (0% to 100% excess in 5% increments) preheated to preheated to (50°C to 200°C in 10°C increments)Write a program that simulates a snail trying to crawl up a building of height 6steps. The snail starts on the ground, at height 0. In each iteration, the snaileither crawls up one step, or slips off one step and falls all the way back to theground. In each iteration you would take a number as input from user and if the number is less 50 than the snail will slip otherwise it will crawl up. The program should keep going until the snail gets to the top of the building. It should then print out the number of falls that the snail took before it finally reached the top.Here is a sample execution:Iteration 1: Please enter a number between [1,100]: 60 Snail Moved: UpIteration 2: Please enter a number between [1,100]: 60 Snail Moved: UpIteration 2: Please enter a number between [1,100]: 40 Snail Moved: DownNumber of falls: 8Write 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 displays two chessboards, as shown in Figure 6.13. Your program should define at least the following function:# Draw one chessboard whose upper-left corner is at# (startx, starty) and bottom-right corner is at (endx, endy)def drawChessboard(startx, endx, starty, endy):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 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 simulates the rolling of two dice. The program should use rand to roll the first dice and should use rand again to roll the second dice. The sum of the two values should then be calculated. Note: Since each dice can show an integer value from 1 to 6, then the sum of the to values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums. Below shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a single-subscripted array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals reasonable (i.e. there are six ways to roll a 7, so approximately one sixth of all the rolls should be 7).Write a program that simulates the rolling of two dice. The program should use rand twice to roll the first die and second die, respectively. The sum of the two values should then be calculated. [Note: Because each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 the least frequent sums.] Figure below shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times Use a one- dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable; i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7. 5 3 4. 56 7 2 4 5 6 7 8 3 4 56 7 8 9 5 6 7 8 9 10 4 5 7 8 9 10 11 6 7 8 9 10 11 121. In the game of Monopoly, a pair of dice are rolled to move a player's piece around the board. If a double is rolled (the dice show the same number), the player receives another roll of the dice. If a double is rolled a second time, a third roll of the dice is received. If a double is rolled on the third occasion, the player forfeits their turn (and goes to Jail). Write a program which simulates two players having 50 turns each (a turn however many dice rolls a player has in a row before it's the other player's turn) and determines: a) the total number of spaces moved by each player; and b) how many times a player rolls a double which results in movement of a piece. Use the randi function. For fun, incorporate the rule that a player cannot leave Jail (cannot move) unless they either roll a double or three turns have passed without rolling a double.
- 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 for a Bookstore to take an order from a customer, calculate how much to charge a customer based on his/her order, and display a receipt. The store sells only three books, designated by their authors: Cervantes ($41.25 each), Homer ($15.85 each), and Shakespeare ($30.50 each). Your program is to work as follows: Display a welcome message (e.g., “Welcome to the Bookstore!”) Prompt the user for his/her first name Prompt the user to input the number of books by Cervantes s/he wants Prompt the user to input the number of books by Homer s/he wants Prompt the user to input the number of books by Shakespeare s/he wants Compute the total amount due, including a 10% sales tax Display amount due Ask the user how much money s/he will pay Display a receipt listing the name of the user, the quantity of each item ordered, the total cost of the order, and the amount the user will have left after paying Execution of the compiled program should appear roughly as follows (with red…using a C++ program code the problem, The game of "23" is a two-player game that begins with a pile of 23 toothpicks. Players take turns, withdrawing either 1, 2 or 3 toothpicks at a time. The player to withdraw the last toothpick loses the game. Write a human vs. computer program that plays "23". The human should always move first. When it is the computer's turn it should play according to the following rules: If there are more than 7 toothpicks left, then the computer should withdraw a random number of toothpicks (from 1 to 3). Use the rand() function, as demonstrated in class to produce this number.. If there are 2, 3 or 4 toothpicks left, then the computer should withdraw enough toothpicks to leave 1. If there is 1 toothpick left, then the computer has to take it and loses. When the human player enters the number of toothpicks to withdraw, the program should perform input validation. Make sure that the entered number is between 1 and 3 (inclusive) and that the player is…