Results 1 to 19 of 19
  1. #1
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Default 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%

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default 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

  3. #3
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    What do you mean write it out on paper ?

  4. #4
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default 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

  5. #5
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    but how do you loop it so that it will always go on?

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by lol12345 View Post
    but how do you loop it so that it will always go on?
    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

  7. #7
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by gimbal2 View Post
    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.
    I understand how to make loops, but what I need help on is how to increase the random numbers every 10 questions

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by lol12345 View Post
    I understand how to make loops, but what I need help on is how to increase the random numbers every 10 questions
    You were asking how to do an ENDLESS loop, not how to do a loop in general.

    Regardless, you must have some idea. What have you come up with yourself so far? If you haven't gotten anywhere yet then you need to listen to the excellent advice SurfDude has given you.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by lol12345 View Post
    I understand how to make loops, but what I need help on is how to increase the random numbers every 10 questions
    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

  10. #10
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by SurfMan View Post
    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 *
    Loop back to? How do I do that?

  11. #11
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by lol12345 View Post
    Loop back to? How do I do that?
    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

  12. #12
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by SurfMan View Post
    Which Java statement is used for loops? (Hint)
    For peet's sake, Do just blurt out out already While you're at it!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  13. #13
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Posts
    100
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    start with 2 variables x and y that increase by 1 every question

  14. #14
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by natdizzle View Post
    start with 2 variables x and y that increase by 1 every question
    And what is "x" and "y" supposed to mean?
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  15. #15
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Posts
    100
    Rep Power
    0

    Default Re: HELP - Math Game Project (import.hsa*)

    numbers in the math problem that increase every question

  16. #16
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by natdizzle View Post
    numbers in the math problem that increase every question
    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

  17. #17
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: HELP - Math Game Project (import.hsa*)

    I tend to meet myself half-way 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

  18. #18
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: HELP - Math Game Project (import.hsa*)

    Quote Originally Posted by gimbal2 View Post
    I tend to meet myself half-way 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.
    Anything better than "X" will do just fine. And no, "XX" does not count. Besides that, with a proper IDE, and I mean IntelliJ IDEA ofcourse (yeah, bring it on!) :), code completion will get me both "numberOfQuestionsAsked" and "questionCount" in 3 keystrokes. :D
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  19. #19
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: HELP - Math Game Project (import.hsa*)

    Black magic!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Best Way To Import a Project?
    By Allan Ocelot in forum Eclipse
    Replies: 2
    Last Post: 03-15-2012, 07:41 PM
  2. Another math game, attempting oop
    By Nanomech in forum New To Java
    Replies: 11
    Last Post: 12-13-2011, 11:41 PM
  3. Math game
    By Nanomech in forum New To Java
    Replies: 61
    Last Post: 09-06-2011, 09:36 AM
  4. Import netbeans project to Webshere
    By Ashish1 in forum NetBeans
    Replies: 3
    Last Post: 05-24-2011, 09:54 AM
  5. How to import java project to Eclipse?
    By techissue2008 in forum Eclipse
    Replies: 1
    Last Post: 05-30-2008, 10:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •