Results 1 to 2 of 2
  1. #1
    thr33 is offline Member
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    0

    Default 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
    correctly, otherwise, the program should display "Please ask your teacher for help".
    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
    (“Congratulations!” or "Please ask your teacher for help", depending on whether the
    student gets more than 7 correct answers or not).

    Implement in Java the algorithms you designed

  2. #2
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    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.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. Need help with school work
    By ccfdet in forum New To Java
    Replies: 3
    Last Post: 08-29-2009, 07:14 PM
  2. Taking Java In School Need Help
    By xEuPhOrIcSx in forum New To Java
    Replies: 7
    Last Post: 02-04-2008, 08:02 AM
  3. Please help... assignment for school
    By confused2000 in forum New To Java
    Replies: 3
    Last Post: 11-12-2007, 08:12 AM

Posting Permissions

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