
Concept explainers
I am creating a lottery
This is the output I am looking for:
Guess the 3 numbers I have chosen - between 0 and 9.
Guess 1 right $10
Guess 2 right $100
Guess 3 right (any order) $1,000
Guess 3 right (exact order) $1,000,000
Enter the 1st number: 2
Enter the 2nd number: 3
Enter the 3rd number: 1
Computer picks: 1 2 3 You guessed: 2 3 1
Any 3 Matches, you win $1,000

Step by stepSolved in 3 steps with 1 images

- Write a program that allows the user to enter timein seconds in the text field and press the Enter key to count down the seconds,as shown in Figure d . The remaining seconds are redisplayedevery second.When the seconds are expired, the program starts to play musiccontinuously.arrow_forwardTo rt z98.arrow_forwardO Placing one loop inside the body of another loop is called nesting. When you "nest" two loops, the outer loop takes control of the number of complete repetitions of the inner loop. Write the code that will generate the output as shown below: How many lines? 8 ★メ *** ** -Ask the user, how many lines this triangle must contain. (1 to n lines) **: -The display pattern must respect the pattern below. ***** *** How the program should interact with the user:arrow_forward
- A company approaches you to create an algorithm for calculating the tax and the tip on a restaurant bill. Assume that the application will only tip on the food and beverage total without the tax added in. Your algorithm will allow the user to input the amount of the tip in custom mode or your algorithm will give the tip in 12%, 15%, 18%, 20% recommended increments. Your job is to create the first three steps of the problem-solving process for this algorithm design. Please make sure that you explore the problem space to determine the criteria and constraints in Part 1. Be creative think of all the inputs and outputs you will be using. For Part 2 think of all the questions that you might have in determining how to actually make such a program. And for Part 3 make sure that you specify (pencil and paper – take a picture of it and include it in your document) a couple of examples of your algorithmic process.arrow_forwardCreate a flowchart that asks the user to any number (num). These number can either be odd or even. If the number is even, count how many even numbers were inputted and stop until such time that the user inputted 0. For example: Input any positive number – 3 Input any positive number – 6 Input any positive number – 2 Input any positive number – 1 Input any positive number – 8 Input any positive number – 0 The total number of even numbers = 3arrow_forwardI am creating a lottery program in Java. That generates three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each of the user's guesses to the three random numbers and display a message that includes the user's guess, the randomly determined three digits, and the amount of money the user has won. Make certain that your application accommodates repeating digits. I also need to identify and document all test cases. This program cannot include loops only branching. This is the output I am looking for: Guess the 3 numbers I have chosen - between 0 and 9.Guess 1 right $10Guess 2 right $100Guess 3 right (any order) $1,000Guess 3 right (exact order) $1,000,000Enter the 1st number: 2Enter the 2nd number: 3Enter the 3rd number: 1Computer picks: 1 2 3 You guessed: 2 3 1Any 3 Matches, you win $1,000arrow_forward
- Create a program called loopExercise. Prompt the user to enter two values (indicate the range). Use a while loop to generate two random values using an appropriate range. The loop should be controlled by the two values entered. Once both values have been randomly generated, the loop should terminate. Include a counter variable to count the number of iterations. Once the loop terminates, print the final randomly generated values and the number of iterations it took to generate those two values. Use logical operators where appropriate. Submit code. JAVAarrow_forwardWhich kind of while loop may be broken by entering a letter or number into the input field? The loop's eof, counter, and flag may all be managed with the help of the loop sentinel.arrow_forwardTaking a Restaurant Order: User Confirmation Style. Using the restaurant menu you selected below you will create a program that will take an order from a customer and calculate the total. Your program shall, Display the menu with the prices. Take an order using the User Confirmation approach The user will input numbers between 1 and 10, according to the menu you created in assigment below. Inform the user about invalid input values (greater than 10 or less than 1) Add the prices of the dishes ordered (you will need a variable to add the prices as in Listing 5.5, p. 141). After taking the order, the program displays the subtotal, the sales tax (8.75%), the grand total, and a suggested 15% tip. You can use the program you created below and modify to incorporate the new requirements. Notice that you will still need the multi-way conditional to add the right price value to the running total of the order. import sys #Enter number for each dish and price for users DishNumber=…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





