Results 1 to 6 of 6
- 12-17-2010, 09:08 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
- 12-17-2010, 09:19 AM #2
build your string of asterix inside a loop.
loop start
string += "*";
loop end
- 12-17-2010, 09:21 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
dont really understand what you mean in new to java :(
- 12-17-2010, 09:32 AM #4
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
This is my programe so far i hope u can understand what im trying to do now
Java Code:/* Thomas Roberts horse simulation game. */ import java.util.*; public class horse{ public static void main(String args[]){ /* declare variables */ String name =""; String hname1 =""; String hname2 =""; String hname3 =""; String hname4 =""; String as = ""; int win = 0; int horse1 =0; int horse2 =0; int horse3 =0; int horse4 =0; int loop = 0; int rndloop = 0; Random gen = new Random(); Scanner scr = new Scanner(System.in); horse1 = gen.nextInt(15)+1; horse2 = gen.nextInt(15)+1; horse3 = gen.nextInt(15)+1; horse4 = gen.nextInt(15)+1; /* send instructions to the screen*/ System.out.println("You must first enter your name and then enter the names of the 4 horses in the race."); System.out.println("You must then pick which number horse you want to bet on."); System.out.println("To start the race press 1 and wait for results.") ; System.out.println("This will display the distance traveled in a line of *"); System.out.println("Enter your name"); name = scr.next(); System.out.println("enter the name for horse1"); hname1 = scr.next(); System.out.println("enter the name for horse2"); hname2 = scr.next(); System.out.println("enter the name for horse3"); hname3 = scr.next(); System.out.println("enter the name for horse4"); hname4 = scr.next(); System.out.println("enter the number of the horse you want to bet on"); win = scr.nextInt; System.out.println("press 1 to start the race"); loop = scr.nextInt(); while(loop == 1){
- 12-17-2010, 09:42 AM #5
Last edited by j2me64; 12-17-2010 at 09:48 AM.
- 12-17-2010, 09:58 AM #6
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
<logic:equal> tag
By satyaprsp in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-18-2010, 07:52 AM -
help with not equal to operator !=
By manowar689 in forum New To JavaReplies: 9Last Post: 06-15-2010, 12:10 AM -
How to encode a fileHandler to output french characters ?
By l.najm@acteos.com in forum Advanced JavaReplies: 4Last Post: 04-22-2010, 09:21 AM -
equal() method
By need_helpp in forum New To JavaReplies: 3Last Post: 03-09-2010, 05:57 PM -
checking if there are equal numbers
By nalinda in forum New To JavaReplies: 0Last Post: 11-18-2007, 02:13 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks