
How to create math problems by grade level. Please Help Me.
Hi everyone I am new to computer programming, and I need help with creating a code that will create random addition or subtraction from 0500 depending on their grade level. I know how to create a random for the math and subtraction. I just dont know how to get it to change depending on their grade level. Example I need it to ask their name, grade level, addition or subtraction then five addition or subtraction questions depending on what they chose.
Please help me out.
If you need more detailed information just let me know, and I can break the whole thing down and show you what I have so far.

Re: How to create math problems by grade level. Please Help Me.
Quote:
how to get it to change depending on their grade level.
Can you explain what that means?
Give a couple of examples.

Re: How to create math problems by grade level. Please Help Me.
Thanks for replying so quickly, What I need it to do is ask the user what grade they are in from 15 then ask the user if they want to do the addition or subtraction problems, so if the student says they are in the 1st grade it will generate either addition or subtraction problems from 1100, and if in 2nd grade it will be from 1200 and so on.
If this is still confusing I can send you an email with an attachment as to what it should look like when it runs.

Re: How to create math problems by grade level. Please Help Me.
Is this it:
For each grade (15) there is a different range of numbers to be used in the math problems.
What problems are you having with that? Do you have any specific questions?

Re: How to create math problems by grade level. Please Help Me.
I think I posted the reply did you get it?
 Update 
not sure if you ever recieved my reply, but I just need help with how to write the code for the random math generator to recognize their grade level.

Re: How to create math problems by grade level. Please Help Me.
Quote:
I posted the reply did you get it?
There are 5 posts before this one, which one is the "reply" you refer to?
Quote:
how to write the code for the random math generator to recognize their grade level.
I thought the grade level was given by the user as input to the program.
Or is the program supposed to randomly generate a grade level for the user?

Re: How to create math problems by grade level. Please Help Me.
no I need the program to ask their grade level, but I do not know how to write a code that will create the problems based on their grade level. I think I might be confusing you. I have only been learning Java for about two weeks now. So I have no clue on how to do this.
I can send you an attachment that shows how the program should run if youd like.

Re: How to create math problems by grade level. Please Help Me.
Ok, the program gets the grade level from the user
Then what will it do with that information?
Make a list of the steps the program will take here.
Worry about how to make a java program after the steps to solve the problem have been written down.

Re: How to create math problems by grade level. Please Help Me.
ok so first:
// ask the user for their name
// ask the user for their grade level
// ask the user if they want to do the addition or subtraction problems
// generate random addition or subtraction based on their reply while keeping a count on the number of correct answers
// then give them a report of the number of correct answers and the percentage correct.
// finally ask the user if they would like to run the program again.

Re: How to create math problems by grade level. Please Help Me.
Ok, some of those steps need further expansion. For example:
Quote:
generate random addition or subtraction based on their reply while keeping a count on the number of correct answers
What are "random addition or subtraction"s? Give an example.
Where are the "correct answers" detected? I assume a question was asked for the user to answer.

Re: How to create math problems by grade level. Please Help Me.
ok so based on their grade level I need to generate 5 math problems for them to answer. so if they say they are in the third grade and they want to do the addition problems my progam should then begin and ask them a math question from 0300 five times total. if they answer a problem correctly it will let them know that they are correct and move on to the next math problem. If incorrect it will let them now it was wrong and move on to the next problem. Once they answer all five problems it will then generate a report for them on how they did.
 Update 
================================================== ==========
Welcome to the Math Practice Program
================================================== ==========
Enter student’s name: Ashley D
Enter grade level between 1 and 5: 9
We only test grades 1  5...Try Again!
Enter grade level between 1 and 5: 3
What test do you want? (1 for addition, 2 for subtraction)
Enter now > 1
================================================== ==========
Starting the Addition Practice Test for Grade Level 3
================================================== ==========

Question 1

102
+ 136

Your answer > 238
>>> Correct <<<

Question 2

264
+ 62

Your answer > 326
>>> Correct <<<

Question 3

4
+ 36

Your answer > 40
>>> Correct <<<

Question 4

102
+ 136

Your answer > 389
>>>> WRONG <<<<

Question 5

222
+ 270

Your answer > 342
>>>> WRONG <<<<
================================================== ==========
Addition Practice Test Results
================================================== ==========
Student’s Name: Ashley D
Grade Level: 3
Correct Answers: 3
Wrong Answers: 2
Percent Correct: 60%
================================================== ==========
Do you want to try again? (1 for yes, 2 for no)
Enter now > 1
Enter grade level between 1 and 5: 1
What test do you want? (1 for addition, 2 for subtraction)
Enter now > 7
You must enter a 1 or 2...Try Again!
What test do you want? (1 for addition, 2 for subtraction)
Enter now > 2
 Update 
that is what it should look like when the program runs.

Re: How to create math problems by grade level. Please Help Me.
Can you post the steps one per numbered line instead of writing a paragraph so I can refer to them by number. That will make it a lot easier.
What are the steps for:
Quote:
generate random addition or subtraction based on their reply while keeping a count on the number of correct answers

Re: How to create math problems by grade level. Please Help Me.
the steps are
1. ask an addition or subtraction problem
2. if the answer is correct let them know
3. ask them another math problem ( five times total)
4. once they have answered all 5 problems display how many they got right and how many wrong.

Re: How to create math problems by grade level. Please Help Me.
Quote:
ask an addition or subtraction problem
What are the steps to decide on which type of question
and to build the question?

Re: How to create math problems by grade level. Please Help Me.
1.the program will ask them if they would like to take the addition or subtraction test. // 1 for addition 2 for subtraction
2. If they choose 1 then all five math problems will be addition.

Re: How to create math problems by grade level. Please Help Me.
That will have to do for now. You've skipped over how a question is created.
Which step in that list of steps for the whole program do you want to work on?
Write code for the steps one at a time, compile the code and execute it to test that it works before moving to the next step in the list.

Re: How to create math problems by grade level. Please Help Me.
I have completed these steps:
1. ask the user for their name
2. get their grade level
Now I need to figure out how to compile a code for their math problems and how to add the correct and incorrect total.

Re: How to create math problems by grade level. Please Help Me.
Ok. That should have been outlined in the steps you posted for how to solve the problem. Review those.
Remember to do them one at a time.
I'm done for tonight.

Re: How to create math problems by grade level. Please Help Me.
For this program, you need to understand properly what it asks. First it says to take name as input, which has practically no relation with the logic. That done, take the grade as input. Remember to keep it in a do while loop and check if input is within 1 to 5. Now initialize a variable with value grade*100
which will be used as limit to generate random integers according to grade (i.e. 100 for 1, 300 for 3, etc.). Take input of addition or subtraction and then generate 2 random integers in a for loop which runs from 1 to 5 (for 5 questions). Every time, it generates 2 random integers within the given limit and then add or subtract them. Take input of the answer and match it with the addition or subtraction result. Keep track of no. of correct answers and no. of wrong answers and after the loop, calculate the result, which you should be able to do by yourself. Keep the whole thing in a do while loop and take input if user wants to continue. if yes, whole thing runs again otherwise  Thank you.
Overall, it is a good program. Practice more programs like these.
Thank you.

Re: How to create math problems by grade level. Please Help Me.
Before diving headfirst in  draw out the program and concepts using pseudocode.
It is sort of half Java half not  you think out your steps and conditions in the same order you would
if actually writing the program. When that is done  test it psychologically in your mind  i.e become the
user of the program. When you are more or less certain part of it works, then translate that part into
Java and see if you were correct. If not, go back to the pseudocode and try again. :)
Wishes Ada xx

Re: How to create math problems by grade level. Please Help Me.
So is pseudocode going to help me figure out what to input? I know how my layout should be I just don't know what to type for this to work.

Re: How to create math problems by grade level. Please Help Me.
Quote:
what to type for this to work.
What step are you working on? What specific problems are you having with writing the code for that step.
pseudo code is a "language" that is closer to human speech and not a proper computer language. The steps I was trying to get you to list for the project were similar to pseudo code. Do a Google for a better explanation.

Re: How to create math problems by grade level. Please Help Me.
So how would you do this in eclipse or something? I know how to write code for asking the name and grade, but I just don't know how to write a code for the random math problems etc.

Re: How to create math problems by grade level. Please Help Me.
Quote:
code for the random math problems etc.
You listed the steps for this. If they are not complete, then go back and redo the steps that the program must do. When you have made a list of the steps for that part of the program THEN work on writing the java code for them. You must have thought through the steps BEFORE trying to write any code.

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