Results 1 to 19 of 19
 11202013, 05:01 PM #1Member
 Join Date
 Nov 2013
 Posts
 6
 Rep Power
 0
HELP  Math Game Project (import.hsa*)
Can someone explain to me how to make this program?
I get how to make random equations, but the assignment requires me to make the program increase in difficulty every 10 questions. The questions need to be increasing in difficulty forever. The program will last until the person types in "quit".
The import is import hsa.*
Create a math game for elementary school kids. Addition and subtraction are the basic skills needed to be
tested in this program. The program will randomly generate whole numbers and equations for the students.
For example, the first question might ask the student to add two single digit numbers. The second question
might ask to subtract two single digit numbers. The difficulty of the questions should increase every 10
questions. Difficulty can be increased by increasing the number of digits being added/subtracted.
When subtracting, ensure that the first number is larger than the second. The student’s current “score”
should be written on the screen. Example: You got 20 of 25 right. 80%
 11202013, 05:04 PM #2
Re: HELP  Math Game Project (import.hsa*)
Write it out on paper. How would you do it if it was a real life game?
"It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11202013, 05:09 PM #3Member
 Join Date
 Nov 2013
 Posts
 6
 Rep Power
 0
Re: HELP  Math Game Project (import.hsa*)
What do you mean write it out on paper ?
 11202013, 05:15 PM #4
Re: HELP  Math Game Project (import.hsa*)
Like it says: write it out on paper. Get a piece of paper. And a pen. And start writing all the actions and ifs you would do as if it were a real life game. Since you are completely clueless, I'll start:
Game start:
 Set difficulty to 1
 Generate 2 random numbers
 Present them to the user
 Get input from the user
 if the answer is correct, add 1 to the number of correct answers
 ....
Find patterns, things that repeat, numbers you need to track. Once you find these, you can translate it fairly easily to Java code."It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11202013, 05:22 PM #5Member
 Join Date
 Nov 2013
 Posts
 6
 Rep Power
 0
Re: HELP  Math Game Project (import.hsa*)
but how do you loop it so that it will always go on?
 11202013, 05:30 PM #6Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,063
 Rep Power
 8
Re: HELP  Math Game Project (import.hsa*)
Excellent question! As an exercise on how to find information, try a Google for "java endless loop" and see what you get. Note how I start that search with the word "java"  that puts your problem into context for Google so you get results that are specific to Java. Search results can be daunting for people who are new to the subject, but don't give up. Read through a couple of results and see if you can figure something out. Its a good feeling when you do which will motivate you to keep going.
"Syntactic sugar causes cancer of the semicolon."  Alan Perlis
 11202013, 05:35 PM #7Member
 Join Date
 Nov 2013
 Posts
 6
 Rep Power
 0
 11202013, 05:49 PM #8Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,063
 Rep Power
 8
Re: HELP  Math Game Project (import.hsa*)
"Syntactic sugar causes cancer of the semicolon."  Alan Perlis
 11202013, 07:30 PM #9
Re: HELP  Math Game Project (import.hsa*)
The answer is in the question: increase the random numbers every 10 questions.
Again: pen and paper:
 Things I want to remember: numberOfQuestionsAsked, difficulty
* Present a question to the user, taking difficulty into account
 If the answer is correct, increase numberOfQuestionsAsked by 1
 If the numberOfQuestionsAsked is 10 then difficulty must be increased by 1, and the numberOfQuestionsAsked should be set to 0, since we start a new difficulty
 Else, give a new question, loop back to *"It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11222013, 03:44 PM #10Member
 Join Date
 Nov 2013
 Posts
 6
 Rep Power
 0
 11222013, 03:48 PM #11
Re: HELP  Math Game Project (import.hsa*)
Which Java statement is used for loops? (Hint)
"It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11222013, 03:52 PM #12Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,063
 Rep Power
 8
 11232013, 07:41 PM #13
Re: HELP  Math Game Project (import.hsa*)
start with 2 variables x and y that increase by 1 every question
Nathan Victor Nelson
http://www.nathanscomputerknowledge.com
 11242013, 11:51 PM #14
 11252013, 05:02 AM #15
Re: HELP  Math Game Project (import.hsa*)
numbers in the math problem that increase every question
Nathan Victor Nelson
http://www.nathanscomputerknowledge.com
 11252013, 10:52 AM #16
Re: HELP  Math Game Project (import.hsa*)
And what does "X" and "Y" really stand for? I mean, if you're giving out advice, make it count. "X", is that a coordinate, a mysterious man, what? What does "X" stand for? If it's the number of questions asked, why not suggest naming it "numberOfQuestionsAsked"? I know it's 21 characters more, but a) the wear on your keyboard is neglectable, and b) it's clearer to maintain.
"It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11252013, 11:11 AM #17Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,063
 Rep Power
 8
Re: HELP  Math Game Project (import.hsa*)
I tend to meet myself halfway there; I'd call it "questionCount" which is longer and far less vague than "X" but shorter and less CaPiTalPrOne than numberOfQuestionsAsked / getNumberOfQuestionsAsked() ;)
Ah proper variable naming... so important and yet so easily tossed aside."Syntactic sugar causes cancer of the semicolon."  Alan Perlis
 11252013, 11:26 AM #18
Re: HELP  Math Game Project (import.hsa*)
"It's not fixed until you stop calling the problem weird and you understand what was wrong."  gimbal2™ © 2013
 11252013, 11:31 AM #19Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,063
 Rep Power
 8
Similar Threads

Best Way To Import a Project?
By Allan Ocelot in forum EclipseReplies: 2Last Post: 03152012, 08:41 PM 
Another math game, attempting oop
By Nanomech in forum New To JavaReplies: 11Last Post: 12142011, 12:41 AM 
Math game
By Nanomech in forum New To JavaReplies: 61Last Post: 09062011, 09:36 AM 
Import netbeans project to Webshere
By Ashish1 in forum NetBeansReplies: 3Last Post: 05242011, 09:54 AM 
How to import java project to Eclipse?
By techissue2008 in forum EclipseReplies: 1Last Post: 05302008, 10:07 PM
Bookmarks