Introduction to Java using NetBeans

Section 4 - Random Numbers

 

Learning Goals

What we are Learning how to.......

- calculate random numbers in a range

 

Success Criteria

What I'm Looking For......

- bug free java applications that efficiently solve the problems presented
- problem solving skills (try before you ask)
- efficient algorithm implementation
-modular programs
- formated and documented code
- organized website with code and executables
- neat, organized, GUI that is user friendly

Curriculum Expectations

Programming Concepts and Skills
- demonstrate the ability to use different data types and expressions
- use proper code maintenance techniques when creating computer programs.

Software Development
- manage the software development process effectively

Designing Modular Programs
- apply modular design concepts

 

Generating Random Numbers


Games, simulators, screen savers, and many other types of applications make use of random numbers.

Dice are a common element in many games. In this activity, you will use random numbers to create a program that simulates the roll of a pair of dice.

 

 

Tutorial 5.1 - The random() Method and Rolling Dice

 

 

import java.lang.Math;

 

 

 

Use the information above to create "A Rolling Dice Program:

Create the following form:

 

 

Create a form
Create 2 integer Variables intDie1 and intDie2
Randomly generate the values
Display them in the appropriate text box

 

 

 

 

Assignment 4.1 Random Numbers

Create a form that prompts the user to enter the minimum and maximum values for their random numbers. The program should then calculate the random number and display it in the form.



For this assignment post the following:

1. Embed the Project Folder
2. Embed the Jar File Folder
3. The code for the JFrame Form
4. Screen shot of the output
5. Code
(Use http://www.planetb.ca/syntax-highlight-word to keep the code in the proper format)

No Rubric for this Assignment it will be evaluated with the next Section