Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Random Number Generator Overview Create a console application that allows the user to generate random values. The user should first be presented with a

image text in transcribed
image text in transcribed
Assignment Random Number Generator Overview Create a console application that allows the user to generate random values. The user should first be presented with a greeting and then a menu of choices: Welcome to the Random Generation Game! Choose an option below: 1: Generate a random array of numbers! 2: Flip a coin 3: Create a random color 4: Exit! Note: You will need to use the Random class to complete this assignment. User Choice 1 If the user chooses option 1, then they will be asked how many elements they want in the array as well as a minimum and maximum number value: Choose an option below: 1: Generate a random array of numbers! 2: Flip a coin! 3: Create a random color! 4: Exit How many elements do you want in your array? Min value? Max? You should then generate an array with that many elements, where each element lies between minimum and maximum (inclusive!). Afterwards, you should print the array to the console using the following notation: [18, 41, 30, 5e, 3, 16, 6, 49, 8, 38, 13, 21, 33, 14, 35, 47, 22, 2e, 1, 37] User Choice 2 If the user chooses option 2, then they will be asked how many coins they would like to flip: Choose an option below: 1: Generate a random array of numbers! 2: Flip a coin! random color 3: Create a 4: Exit! How many coins do you want to flip? You should then use the nextBoolean0 method from the Random class to choose "heads or "tails for each flip. You should print each toss to the console, as well as the total heads" and "tails": heads, heads, heads, tails, heads You flipped 4 heads and 1 tails

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions