Concept explainers
The video game machines at your local arcade output coupons according to how well you play the game. You can redeem 10 coupons for a candy bar or 3 coupons for a gumball. You prefer candy bars to gumballs. Write a
Trending nowThis is a popular solution!
Chapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Concepts Of Programming Languages
Web Development and Design Foundations with HTML5 (8th Edition)
Modern Database Management
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Degarmo's Materials And Processes In Manufacturing
- There is a variable that adds up several numbers.arrow_forwardScientists measure an object’s mass in kilograms and its weight in Newtons. If you know the amount of mass of an object, you can calculate its weight, in Newtons, with the following formula: Weight = Mass × 9.8Create an application that lets the user enter an object’s mass and then calculates its weight. If the object weighs more than 1000 Newtons, display a message indicating that it is too heavy. If the object weighs less than 10 Newtons, display a message indicating that it is too light.arrow_forwardPYTHON 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_forward
- The following table shows the approximate speed of sound in air, water, and steel: Write a program that asks the user to enter “air”, “water”, or “steel” and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: Time = Distance / 1,100 You can calculate the amount of time it takes sound to travel in water with the following formula: Time = Distance / 4,900 You can calculate the amount of time it takes sound to travel in steel with the following formula: Time = Distance / 16,400arrow_forwardThe CarMin dealership has approached you to write a program to keep track of the sales commissions paid to the sales team each time they sell a used car. The amount of the commission that a salesperson earns is based on the type of vehicle sold. Currently CarMin is trying to incentivize it salesforce to try and sell Hybrids and SUVS because these vehicles generate the most profit within the dealership. These vehicle types have the highest commissions. Vehicle Type Bonus Commission Hybrid 4.0% of Selling Price Coupe 1.5% of Selling Price Sedan 1.5% of Selling Price SUV 3.0% of Selling Price Minivan 2.5% of Selling Price Create a program for use by the sales manager to track commissions by vehicle type. It is unknown how many cars the dealership will sell in a given month. The program should allow the manager to continuously enter a vehicle type and selling price each time a vehicle is sold. You must validate the vehicle type and selling price using appropriate validation. If any…arrow_forwardWrite the pseudocode to create a lotto game. The user will select three numbers from 1 to 9. If the user enters a number outside of this range, then they must beprompted to re-enter the number until it meets the criteria. The numbers must be unique and must not be duplicated. Generate three random numbers from 1 to 9 in value and compare the three random numbers against the user's selection of numbers. If they are equal to the random number, then that is match.arrow_forward
- // This pseudocode is intended to compute the number// of miles per gallon you get with your automobile.start input milesTraveled input gallonsOfGasUsed milesPerGallon = milesTraveled + gallonsOfGas output milsperGallonstartarrow_forward99 question 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.arrow_forwardThe video game machines at your local arcade output coupons according tohow well you play the game. You can redeem 10 coupons for a candy bar or 3coupons for a gumball. You prefer candy bars to gumballs. Write a program thatdefines a variable initially assigned to the number of coupons you win. Next,the program should output how many candy bars and gumballs you can get ifyou spend all of your coupons on candy bars first, and any remaining couponson gumballs.arrow_forward
- pythonarrow_forwardI am trying to create a application that generates a random number in the range of 1 through 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.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Accumulate the guesses until the user guesses the number. When the user correctly guesses the random number, the program should display the number of guesses they took. "You guessed the number in # guesses", where # is the number of guesses it took. And the programming language i am using is visual basic or vb.net 2019 editionarrow_forwardThe Problem: You need to increment a variable in the fastest possible way.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning