aodhidbrbeididbe's status on Monday, 13-Jun-11 23:21:39 UTC
-
import java.util.Scanner; public class main { public static void main(String[] args) { double a; int c; int d; int s = 0; int f = 0; Scanner in = new Scanner(System.in); System.out.println("GUESS THE NUMBER!"); while(f < 10) { a = Math.floor(Math.random()*10); c = (int)a; d = in.nextInt(); if(d == c) { System.out.println("YOU GOT IT RIGHT!"); s++; } else { System.out.println("YOU WERE WRONG - THE CORRECT ANSWER WAS " + c); s--; } f++; } System.out.println("THANKS FOR PLAYING GREG'S NUMBER GUESSING GAME \n YOUR TOTAL SCORE WAS " + s); } } i added some new stuff to the code...