Results 1 to 7 of 7
Thread: Multiplication Tables game
- 01-04-2013, 03:56 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 3
- Rep Power
- 0
Multiplication Tables game
Design, implement and test a Java program which presents the user with the following menu.
1 ... Times tables – (select and view)
2 ... Practise - (select and practise)
3 ... New game - (10 random times tables sums)
4 ... Quit
Enter option ....
1. When this option is chosen, the user is asked to input a number 1- 12. The times tables for that number shall then be displayed.
2 When this option is chosen, the user is asked for a number (1 to 12) and then the user is prompted for the result of each time table for the number starting at 1 and incrementing to 12. If the user gets the sum correct then an appropriate message is displayed and if incorrect the correct answer is displayed. At the end of the series the number of correct answers the user gets is displayed.
3 When this option is chosen, the program displays 10 random times table sums (limited to 1 to 12 only) to complete. If the user gets the sum correct then an appropriate message is displayed and if incorrect the correct answer is displayed. At the end of the series the number of correct answers is displayed.
I've done the first part of question 1, but I can't get the validation to work.
e.g if (option < =0 || Choice >=13) {
System.out.println( "Invalid. Please enter a number between 1 & 12);
What am I doing wrong?
- 01-04-2013, 04:00 PM #2
Member
- Join Date
- Jan 2013
- Posts
- 3
- Rep Power
- 0
Multiplication Tables game
Design, implement and test a Java program which presents the user with the following menu.
1 ... Times tables – (select and view)
2 ... Practise - (select and practise)
3 ... New game - (10 random times tables sums)
4 ... Quit
Enter option ....
1. When this option is chosen, the user is asked to input a number 1- 12. The times tables for that number shall then be displayed.
2 When this option is chosen, the user is asked for a number (1 to 12) and then the user is prompted for the result of each time table for the number starting at 1 and incrementing to 12. If the user gets the sum correct then an appropriate message is displayed and if incorrect the correct answer is displayed. At the end of the series the number of correct answers the user gets is displayed.
3 When this option is chosen, the program displays 10 random times table sums (limited to 1 to 12 only) to complete. If the user gets the sum correct then an appropriate message is displayed and if incorrect the correct answer is displayed. At the end of the series the number of correct answers is displayed.
I've done the first part of question 1, but I can't get the validation to work.
e.g if (option <=0 || option >=13) {
System.out.println( "Invalid. Please enter a number between 1 & 12);
What am I doing wrong?
Really need help with this.Last edited by beansnet; 01-04-2013 at 04:20 PM.
- 01-04-2013, 04:07 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Re: Multiplication Tables game
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 01-04-2013, 04:19 PM #4
Member
- Join Date
- Jan 2013
- Posts
- 3
- Rep Power
- 0
Re: Multiplication Tables game
Hi Jos,
Thanks for taking time out to help.
Sorry, I meant
"if (option <= 0 || option >= 13) {"
I have it written like this and it still won't work, it's saying "illegal start of expression."
- 01-04-2013, 04:49 PM #5
Re: Multiplication Tables game
Please go through the Forum Rules, particularly the second paragraph. I've merged your two threads here.
You probably also need to go through Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-04-2013, 04:50 PM #6
- 01-04-2013, 04:51 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Multiplication practice app
By Mikki in forum New To JavaReplies: 4Last Post: 06-24-2012, 11:38 PM -
Secondary input bug within times tables game,
By Martyn in forum New To JavaReplies: 14Last Post: 01-09-2012, 01:56 AM -
need help with multiplication
By dakid2 in forum New To JavaReplies: 10Last Post: 03-08-2011, 03:41 AM -
Help with Multiplication
By phil028 in forum New To JavaReplies: 1Last Post: 12-06-2007, 07:39 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks