Concept explainers
How Many Widgets?
The Yukon Widget Company manufactures widgets that weigh 12.5 pounds each. Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Database Concepts (7th Edition)
Starting Out with Python (4th Edition)
Starting Out With Visual Basic (7th Edition)
Digital Fundamentals (11th Edition)
- In the Raptor program 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’t display 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. (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…arrow_forwardScissor, rock, paper Write a program called GameSRP.java that plays the popular scissor-rock-paper game where a scissor can cut paper, a rock kan nock a scissor and a paper can wrap a rock. The program asks the user for one of the options (1 for scissor, 2 for rock or 3 for paper) and then randomly picks one of them for the computer. It then presents if you or the computer won, or if it was a draw. If the user enters 0 the program will end and display the total score (number of wins for you and the computer and the draws). Here is a sample run: Scissor (1), rock (2), paper (3) or 0 to quit: 1 You lost, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 2 It's a draw! Scissor (1), rock (2), paper (3) or 0 to quit: 3 You won, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 1 You lost, computer had rock! Scissor (1), rock (2), paper (3) or 0 to quit: 2 It's a draw! Scissor (1), rock (2), paper (3) or 0 to quit: 3 You won, computer had rock! Scissor (1),…arrow_forwardPlease add commentsarrow_forward
- PYTHON PROGRAMMING Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and continue to loop your program…arrow_forwardIn C# language using Microsoft Visual Studio in Windows Forms App (.NET Framework) A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Create an application that simulates a slot machine. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols.arrow_forwardThis needs to be made in Javascript. Leap Year Detector: Design a program that asks the user to enter a year, then displays a message indicating whether the year is a leap year. (If the year is evenly divisible by 100 and is also evenly divisible by 400, then it is a leap year. For example, 2000 is a leap year, but 2100 is not. If the year is not evenly divisible by 100 but is divisible by 4, then it is a leap year. For example, 1996 is a leap year, 1997 is not. )arrow_forward
- PYTHON CODE Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and continue to loop your program asking…arrow_forwardMicrowaves / Radio Waves If a scientist knows the wavelength of an electromagnetic wave she can determine what type of radiation it is. Write a program that asks for the wavelength in meters of an electromagnetic wave and then displays what that wave is according to the following chart. (For example, a wave with a wavelength of 1E-10 meters would be an X-ray.) 1x 10-11 1 x 10-8 4 x 10-7 7x 10-7 1x 10-3 1 x 10-2 Gamma Rays. X Rays Ultraviolet Visible Light Infraredarrow_forwardJava:arrow_forward
- Pythonarrow_forwardC Programming Language Task: Pascal's Triangle Write a program to print Pascal's triangle. In Pascal's triangle Each number is the sum of the two numbers above it. You may assume the maximum height for this task is 20. Print each character with 5 spaces of padding. e.g.printf("%5d", variable) 1 1 1 1 2 1 133 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1arrow_forwardJAVA Project 2-3 Rectangle Calculator Create an application that calculates the area and perimeter of a rectangle. Then using a loop, ask the user if they want to continue. If yes then repeat the input, processing, and output. If no then end the program. Console Welcome to the Area and Perimeter Calculator Enter length: 100 Enter width: 200 Area: 20000.0 Perimeter: 600.0 Continue? (y/n): y Specifications The formulas for calculating area and perimeter are: area = width * lengthperimeter = 2 * width + 2 * length The application should accept decimal entries like 10.5 and 20.65. Assume that the user will enter valid numeric data for the length and width. The application should continue only if the user enters “y” or “Y” to continue. Input: Print the header "Welcome to the Area and Perimeter Calculator" Ask the user to enter a length Ask the user to enter a width Processing: Save the length and width in variables Calculate the area and save the results in a variable…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT