Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction to java in NetBean. Basic programing using loops Scenario It is Saturday night, and you are watching the Lottery draw for Fantasy Five. You

Introduction to java in NetBean. Basic programing using loops

Scenario It is Saturday night, and you are watching the Lottery draw for Fantasy Five. You get inspired to write a program to generate 10 lotto tickets, each ticket has 5 Lotto numbers. What loop should you use, and why? Note: To generate the 5 lotto numbers, you could create another loop inside the outer loop. This is called a nested loop. Otherwise, you will have to duplicate the method to generate a random number 5 times.

Here is a tip for doing it: Inside the inner loop that generates the lotto numbers, one at a time in a loop, type: lottoNum = myRan.nextInt(60) + 1; lottoTicket = lottoTicket + " " + lottonNum; This means that as often as you generate a lotto num, you will concatenate it to a String of previously generated lotto numbers.

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

Is speaking well more important than listening?

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago