Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Math tutor/quiz application problems. Uncertain on how to proceed.

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Math tutor/quiz application problems. Uncertain on how to proceed.

    Hello everyone,

    Unfortunately I'm having trouble with a swing application I'm attempting to successfully develop. I'm using Netbeans JFrame Form for this. It's a math quiz application. The question will follow at the end of this. The primary features of it are:

    - It has 6 difficulty levels based on grades (grade 1 through 6).
    - Users have the option to generate math questions either randomly or in a certain order.
    - Users can select the amount of questions they want to answer. (After a question is answered, a next one should generate either by a 'next' button or automatically.

    Other features are filling in your name, live updating score, and end result. These last few bits I have on issue with, however, the ones mentioned above are killing the few amount of braincells I have left.

    I've sort of developed the difficulty levels by using the following code:
     num1 = (int) (Math.random()*41);
                num2 = (int) (Math.random()*41);
    . And depending on the grade, change the range of the numbers.

    Unfortunately that's about as far as I can get. Here are my questions:

    1. How am I supposed to generate an amount of questions based on the user input? (For example, the user enters 5, and generates 5 questions).
    2. How do I get those questions to generate one at a time, after each question is answered? Or by clicking a ''next'' button?
    3. How do I get these components to corrospond together? The grades (difficulty), random (random questions or in order), and generating an amount of questions
    based on user input?

    If you want to provide a practical example (syntax), that's appreciated. Otherwise I'll simply accept a theoretical answer.
    In terms of ''what do you have so far'', it's quite a lot, and I'm not sure what is relevant to post or not.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Math tutor/quiz application problems. Uncertain on how to proceed.

    generate an amount of questions based on the user input
    Use a for loop and save each question in a list

    get those questions to generate one at a time, after each question is answered? Or by clicking a ''next'' button?
    Yes, that sounds like it could work. When the user is finished with a question he would press the Next button to move to the next question.

    generating ...based on user input?
    Display a form for the user to fill in with values to use in generating the questions.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. How to create math problems by grade level. Please Help Me.
    By Mata101Alex in forum What's Wrong With My Code?
    Replies: 43
    Last Post: June 15th, 2014, 01:58 PM
  2. Problems with Math.Random() in a for loop
    By csharp100 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 27th, 2012, 06:18 PM
  3. Quiz application
    By JonoF in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: May 10th, 2010, 06:06 AM
  4. Replies: 1
    Last Post: December 2nd, 2009, 04:01 AM
  5. math quiz program
    By hope.knykcah in forum Collections and Generics
    Replies: 1
    Last Post: October 23rd, 2009, 09:53 AM