Cutter Jones

Greenhorn
+ Follow
since Sep 05, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cutter Jones

It was far from a complete solution, and offered only an idea of where to start.....

To the people who tried to help thank you..

Sometimes text books offer partial or even complete solutions to problems for students to understand.
I in no way wanted my assignment done for me...but just a little help.
I will no longer use this site nor recommend it to anyone else.
14 years ago
Thank you...

Unfortuanatly, we haven't learned "array" yet...I could probably firgure it out, but I don't think that would go over well with my teacher.

I guess my first problem is how do I compare a user input of one 3 digit number to the random 3 one digit numbers...?

There should be a logical way to do this....at least one that a noob like me can understand.
14 years ago
Thank you...

Unfortuanatly, . . .
14 years ago
Hi everyone.

. . .
14 years ago
Hi everyone.

I'm am new....I am stuck...please help

I'm trying to yes...do an assignment, but can't seem to wrap my head around it for some reason.

The assignment is:
-Create a lottery game application.
-Generate three random numbers from 0-9
-Allow the user to guess three numbers.
-Compare each of the users guesses to the three random numbers and
display a message that includes the users guesses and the randomly generated numbers and the amount of $$ won.
-The applications should accomadate repeating numbers.
(ie. the user guesses 1,2,3 and 1,1,1 comes up..he/she should only get credit for the one "1")

I've been going back and forth with different thoughts on how to proceed, and build on what I have.(if possible).

I'm coming here in hopes there is someone, who can guide me in the right direction.
This is where I am so far.


CODE:






Thank you in advance

Cutter
14 years ago
Thanks Campbell Richie...

I tries using three seperate "random" instances but couldn't make heads or tails of my if statements, and scraped the idea.

Do you think that is the way to go?
14 years ago
Sorry...
The assignment is create a lottery
where the user inputs 3 numbers and wins $$ based on the amount of numbers he or she matches.

the user cannot win with matching two numbers
example if 123 is the number randomly generated and the user inputs 121, he /she cannot win twice with the numer 1
14 years ago
Good Morning
Im a very new Java enthusiast,

I'm try to find some help with this please

User inputs 3 numbers
for correct matches then
1 correct wins $10.00
2 correct wins $100.00
3 correct wins $1000.00

if user inputs 123
and random generator comes back 111 he/she should only win once

if user inputs 120 should win twice...etc...etc...

I have if all three numbers match, but seem to have trouble with the other parts...

What I have so far
CODE:

import java.util.*;
import javax.swing.JOptionPane;

public class Lottery

{
public static void main (String[] args)
{

int allRanNumbers;



allRanNumbers = (int)(Math.random() * 1000);
System.out.println(allRanNumbers);

String guessString;
int guess;

guessString = JOptionPane.showInputDialog(null,
"Please enter 3 digits from 0-9", "Lottery Numbers",
JOptionPane.QUESTION_MESSAGE);
guess = Integer.parseInt(guessString);

if (guess == allRanNumbers)

System.out.println("You matched two: you win $1000.00");


CODE:

any help would be greatly appreciated

Thank you

CutterJones
14 years ago