Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Program for Randomly Generated 3- Digit Number Matches

This assignment demonstrates your ability to use basic Java syntax including selection and looping statements. You will need to write a Java application that determines how often a randomly generated 3- digit number matches your favorite 3-digit number. For example, suppose your favorite number is 777, if the computer generated a 3-digit number 1 million times, how often would it pick 777?

Requirements:

There are several requirements for this assignment. Review each requirement before you prepare your solution:

1. Write a Java application called LotteryPick3 that will use an Input Dialog to prompt a user for their lucky 3-digit number and the number of times they would like the simulation to run.

2. You should use input validation to ensure a 3 digit integers was entered and the number of times they want the loop to run is between 1000 and 10 million. Error messages for improper/invalid input should be accompanied by a Dialog message explaining the issue and asking for a re-entry of the invalid data.

3. You will then write the code that generates a random 3-digit number and determines if it matches the lucky number. You will execute the loop the number of times the specified by the user in the input dialog prompt.

4. The simulation should keep track of the number of times the random number matches the lucky number.

5. The program should output using a Dialog box providing the input data as well as the number of times the lucky number was matched.

6. Both programs should compile and run without error.

7. Be sure to test your program carefully. Provide a list of comprehensive test cases used to validate your application.

Deliverables:

You should submit your LotteryPick3.java file in the WebTycho assignments folder prior to the due date of listed in the syllabus. Also, include your test cases used to validate your formulas and the results of your tests in a neatly, organized word document. You should name the word document firstinitiallastnamehw2.doc. (e.g., I would submit jrobertsonhw2.doc)

Java, Programming

  • Category:- Java
  • Reference No.:- M9525178

Have any Question?


Related Questions in Java

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As