# Thread: intro to java problem for school

1. Member Join Date
Oct 2009
Posts
1
Rep Power
0

## intro to java problem for school

Can someone help me with this problem? The trouble I'm having is with the end with (Congratulations! or "Please ask your teacher for help", depending on whether the
student gets more than 7 correct answers or not).

Suppose you are asked to design a software tool that helps an elementary school student learn
arithmetic operations. The software allows the student to select the arithmetic operation she or he
wishes to study. The student chooses from a menu one of two arithmetic operations: 1) addition,
2) subtraction
Based on the student choice, the software tests the user with exactly 10 questions. For each
question, two random positive one-digit integers are generated; then the student is asked to enter
the answer for the arithmetic operation applied to the two numbers.
The software displays a message Congratulations! if more that 7 questions are answered
Question 1 (40 points)
a) Write a problem-solving algorithm to execute the arithmetic test for a student for addition
or subtraction operations. The algorithm receives an integer that represents the required
operation from the main algorithm (1 for addition and 0 for subtraction). The algorithm
then gets the student to answer 10 questions as follows:
a. Randomly generates two positive one-digit integers.
b. Ask the student to enter the answer for the arithmetic operation of the two
numbers,
c. Checks if the result is true.
As questions are answered, the correct answers are counted. The number of correct
answers is returned to the calling algorithm.
b) Create a main algorithm to interact with the student to obtain the choice for either
addition or subtraction and produce the results for a student and then calls the algorithm
developed in part (a) to test the student (recall this algorithm returns the number of
correct answers). The main algorithm prints one of two possible messages to the student
student gets more than 7 correct answers or not).

Implement in Java the algorithms you designed  Reply With Quote

2. Senior Member Join Date
Mar 2009
Posts
552
Rep Power
12

## Please post whatever code you have so far, so we can help you. I believe I speak for all the members of this forum when I say we do not do your work for you, we help you to understand what you need to do.  Reply With Quote

#### Posting Permissions

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