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.

Page 2 of 2 FirstFirst 12
Results 26 to 44 of 44

Thread: How to create math problems by grade level. Please Help Me.

  1. #26
    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: How to create math problems by grade level. Please Help Me.

    Pretend you are explaining the problem to another person. List the steps you need to explain to the other person so he can do the job. Computer programs are a list of simple steps to be done one after the other.
    You need to make that list of steps before you can write the code.
    generate random math problems
    Break that down into simple steps and list them.
    What needs to be done first?
    does not teach you how to write a code
    When you get that list of steps, then we'll work on writing the code.
    If you don't understand my answer, don't ignore it, ask a question.

  2. #27
    Junior Member
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    I don't understand what you want me to do? I broke it down into steps before. Maybe I am misunderstanding what you need to know.
    Steps are:
    1. Ask the user for their name
    2. Ask the user for their grade lvl 1-5
    3. Ask the user if they want to take the addition or subtraction test.
    4. Give the user 5 math problems total either addition or subtraction. Ranging from 1-500, so if they said they are in the third grade the problems will only go up to 300
    5. Let the user know if they answered the problem correctly or incorrectly.
    6. Give the user a report on how they did.
    7. Ask the user if they would like to run the program again.

  3. #28
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    I'm sorry, but there is virtually no code to generate MATH PROBLEMS. NOR there is one to count correct and incorrect, unless you use variables to keep count of correct and incorrect.

  4. The Following User Says Thank You to Abhilash For This Useful Post:

    Mata101Alex (June 14th, 2014)

  5. #29
    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: How to create math problems by grade level. Please Help Me.

    Ok, which steps have you completed? What step are you now working on?
    What specific java coding questions do you have about that step?


    Step 4 looks too complicated. It needs to be broken down into several simpler steps.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #30
    Junior Member
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    I finished the first 3 steps. For step 4 I know how to create a math.random, but I don't know what to put so it knows to give the addition or subtraction problems. And how to change the math problems depending on their grade.

    Thanks for your patience by the way.

  7. #31
    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: How to create math problems by grade level. Please Help Me.

    Work on one type of problem at a time.
    Say the addition one. What does the program need to do to create an addition problem?
    Write down a sample problem and think about how you created it and then write down the steps you took to do it.

    Or did I misread this:
    don't know what to put so it knows to give the addition or subtraction problems.
    Isn't that determined by the user's answer to the question in step 3)?
    pseudo code;
    If (user said do addition) {
      // create addition problem
    }else {
      // create subtraction problem
    }
    If you don't understand my answer, don't ignore it, ask a question.

  8. #32
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Quote Originally Posted by Mata101Alex View Post
    And how to change the math problems depending on their grade.
    I think I had explained that to you. Check your mail. The whole explanation is there. Tell me if you didn't get it. I'll post it here.

  9. #33
    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: How to create math problems by grade level. Please Help Me.

    @Abhilash The idea is to help students learn how to program, not to do their work for them.
    Sending PMs keeps other students from also learning. Please post on the thread.
    If you don't understand my answer, don't ignore it, ask a question.

  10. #34
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Sorry, but I didn't give him any code. Only the explanation. And believe me, it will help him learn.

  11. #35
    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: How to create math problems by grade level. Please Help Me.

    Why hide it in a PM? There are other students that read these threads that could benefit.
    If you don't understand my answer, don't ignore it, ask a question.

  12. #36
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Actually, he asked me a specific question, and specific questions need specific answers. And by the way, it isn't hidden. The same post I had posted before explaining him the logic, that he didn't understand. So I gave an expanded explanation to his question replying to the PM he sent me.

    --- Update ---

    Please tell me if you really want me to post the explanation.

    --- Update ---

    Quote Originally Posted by Norm View Post
    Step 4 looks too complicated. It needs to be broken down into several simpler steps.
    Sorry, but step 4 is not at all complicated, just need a 'for' loop that's all (I've explained before.). Tell me if you want it elaborated again
    .

  13. #37
    Junior Member
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    So I started monkeying around and this is what I have for obtaining their grade lvl:

    public static void getGradeInfo()
    {
    System.out.println(" Enter grade between 1 and 5: ");
    gradeLevel = input.nextInt();
    if (gradeLevel < 1 )

    System.out.println("Must enter a grade lvl between 1 and 5!");

    else (gradeLevel < 1)

    I know there is a way to make it say if (gradeLevel < 1 && > 5)
    but I dont think I am doing it right can someone give me a hand on the right way to do that line there?

    --- Update ---

    is it supposed to be if then else on the bottom or if then while?

  14. #38
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Do you even know programming? Are you new at this? Because your codes say so. Please don't monkey around. I'll help, but for now I have to log out because I have some work now. I'll come back later and explain the whole thing in DETAILS. Just a small advice, don't worry about checking right now because you will get nowhere in this pace. Imagine all inputs are correct. Now do the program. I'm done for now.

  15. #39
    Junior Member
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    I have been programming for three weeks now, so yes I am really new to this. I read through my book a thousand times already and I cannot find out how create a random math generator. I have been looking all over the internet as well and there are a million different ones but I am not sure what one is right.

    And I am not trying to monkey around it is just that I have been looking for help for a while now, but I just keep getting asked questions I am not that experienced with.

  16. #40
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Quote Originally Posted by Mata101Alex View Post
    I have a java programming book, but it does not teach you how to write a code that can generate random math problems and keep count of correct and incorrect. I have been looking everywhere online for help, why is it so hard?
    It won't teach you that either - not that particular problem anyway. It sounds like you are wanting the
    Java book to hold your hand till the end but it won't do that either. What it will teach you however, and
    what other people here will help you do - is understand the concepts and algorithms to get things to a
    level in which you can generate a math problem and keep count of the answers.

    Try breaking it down, here think about these questions. If you cab honesty answer "yes" to all of these,
    you can put it all together to complete your program.

    1. Can you generate a random number?
    2. Can you increment a variable value used for storing counting arithmetic?
    3. Can you create a loop(s) that iterate until a condition is true?
    4. Can you preform basic arithmetic in Java (i.e can you write mathematical evaluations)?
    5. Can you print messages to the screen and ask for basic user input?
    6. Can you output results to the screen that print back the answer?
    7. Can you combine all the above into a working algorithm - that will form logical steps to solve a problem?

    If you can all these - you can solve this. The hardest part of any program is thinking up the correct sequence and
    order that the statements will be executed in. Like Norm was trying to suggest to you in this thread - you need
    to sit down and really think about what the program needs to do - and how you cab tell a computer to do what
    you could write down on a piece of paper.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  17. #41
    Junior Member
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    I am pretty much finished. The only problem I could not figure out is how to run the program again.

    I have created a simple program before that asked if they wanted to run again, and it worked just fine, but this time it is not letting me put in the do and while without giving me some red lines.

  18. #42
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Post the part of the program that is causing the problem with any error messages.
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  19. #43
    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: How to create math problems by grade level. Please Help Me.

    is a way to make it say if (gradeLevel < 1 && > 5)
    Each use of a boolean operator like < or > requires two operands: operand1 < operand2. The copied code needs another operand with the > 5. Also it makes the code more readable if each expression is wrapped with ()s
    if((operand1 < 1) && (operand1 > 5))

    When posting code be sure to wrap your code with code tags:
    [code=java]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  20. #44
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Default Re: How to create math problems by grade level. Please Help Me.

    Quote Originally Posted by Mata101Alex View Post
    I am pretty much finished. The only problem I could not figure out is how to run the program again.

    I have created a simple program before that asked if they wanted to run again, and it worked just fine, but this time it is not letting me put in the do and while without giving me some red lines.
    Did you add semicolon after do-while?
    Eg:-
     do
    { // your codes
    }while(condition); // here, this ';', did you add it, because most people forget to add this

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Question about math.pow and math.sqrt
    By ggx7 in forum Java Theory & Questions
    Replies: 7
    Last Post: March 7th, 2014, 12:51 PM
  2. How do I create a level using different colours in a picture?
    By LukeR in forum Java Theory & Questions
    Replies: 10
    Last Post: December 27th, 2013, 10:48 AM
  3. Replies: 0
    Last Post: October 14th, 2013, 08:30 PM
  4. 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
  5. Finding college level problems
    By DougFane in forum The Cafe
    Replies: 1
    Last Post: February 2nd, 2012, 08:44 AM