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
Software Engineering (10th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Concepts of Programming Languages (11th Edition)
Artificial Intelligence: A Modern Approach
Introduction To Programming Using Visual Basic (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- Problem: A small company needs an interactive program to compute an employee’s paycheck. The payroll clerk will initially input the data, and given the input data, an employee's wage for the week should be displayed on the screen for the payroll check. The data for the employee includes the employee's hourly pay rate and the number of hours worked that week. Wage is equal to the employee's pay rate times the number of hours worked (up to 40 hours). If the employee worked more than 40 hours, wage is equal to the employee's pay rate times 40 hours plus 1½ times the employee's pay rate times the number of hours worked above 40. Instructions: Match the action at the left-side with the correct step number at the right-side (the attached picture). Note that it may be possible to group more than one related actions in the same logical step / process without altering the essence of the algorithm. In the program flow, input and checking of hourly pay rate should come before that of the number…arrow_forwardWrite a program 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.Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.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
- Guess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your program choose the number to be guess by selecting an integer at random in the range 1 to 1000. The program then displays the following: I have a number between 1 and 1000. Can you guess my number? Please type your first guess. The player then type a first guess. The program responds with one of the following: 1. Excellent ! you guessed the number! Would like to play again (y or n)? 2. Too low. Try again. 3. Too high. Try again. If the payer’s guess is incorrect, your program should loop until the player finally get the number right. Your program should keep telling the player Too high or Too low to help the player “zero in” on the correct answer.arrow_forwardIn this program you will ask the user for 4 integers that represent two fractions. First ask for the numerator of the first and then the denominator. Then ask for the numerator and denominator of the second.Your program should add the two fractions and print out the result. For example, a sample program run might look like this Numerator One: 1Denominator One: 2Numerator Two: 2Denominator Two: 5The sum is 9/10 Remember, if you have two fractions you add them with: a c ad + bc __ + ___ = ______ b d bd public class AddFractions { public static void main(String[] args) { //Ask user for the 4 numbers and create necessary variables. //create your final numerator //create your final denominatorarrow_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_forward
- Don't copy.arrow_forwardCreate a program where a user guesses whether the value of the sum of two dice will be even or odd. The game will stop when the number of turns has reached 5. To guess odd, the user enters 1. To guess even, the user enters 2. After each roll, the program should display the two numbers rolled,the sum of the numbers, the user's guess as "Even" or "Odd" and whether they won or lost. Once the player ends the game, the program should display the number of times played and the number of turns won and lost and the number of times the dice were even/odd. Technical Requirements: Must use the random function for each die Use a loop to play the game for 5 turns Use an array to track each roll as to whether it was even or oddarrow_forwardpythonarrow_forward
- The 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. vehicle types have the highest commissions. These 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.…arrow_forwardWrite a Phyton program that computes the duration of a projectile’s flight and its height above the ground when it reaches the target. As part of your solution, you should display instructions to the program user. Relevant formula: time = distancevelocity xcos (θ) height = velocity xsin x time- g x time22 use the following variables: g = gravitational constant = 32.17 = angle of elevation in radian v = velocity or the projectile velocity (ft/sec) d= distance to target t = time of flight in seconds. h = height at impact Try your program on these data sets.arrow_forward(Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)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