#13199: 求JAVA高手


nina042152086 (unknown)

學校 : 國立高雄第一科技大學
編號 : 74189
來源 : [163.18.38.88]
最後登入時間 :
2018-01-05 11:21:12
a111. 12149 - Feynman -- UVa12149 | From: [163.18.38.88] | 發表日期 : 2018-01-03 20:22

Please use JAVA language to make a simple DOS guessing game in which users can guess the next number’s attribute. The next integer number is a random number between 1 and 10(use Math.random() to get a double between 0~1, you may multiple it to a huge number then divide it by 10). The users need to guess whether the next number is an odd or not. You need to define the instructions of the program and prompt the users such as

1.Oddàguess the next number as an odd number

2.Evenàguess the next number as an even number

3.Quitàquit the game

The user will get one score if he/she makes one right choice. Please also print out his/her winning percentage.

Hints: keywords you may need

  BufferedReader      BufferedWriter       FileReader      FileWriter       Scanner  File  StringTokenizer      split()      nextToken()    hasMoreTokens()   readLine()  next()      Math.random()

 
ZeroJudge Forum