Question: Please make simple program were only on beginner loops and methods A Psychology experiment is conducted in two stages. In the first stage, each participant

Please make simple program were only on beginner loops and methods
A Psychology experiment is conducted in two stages. In the first stage, each participant is asked 100
questions. The number of correct answers to these questions is considered as the initial score of the
participant. If the initial score is greater than or equal to 50, the experiment proceeds with stage 2A;
otherwise it proceeds with stage 2B. In stage 2A, the participant's behavioral score (a value between
1 to 50 both inclusive) is added to the initial score. If the sum is greater than or equal to 85.5,
the participant is selected. Otherwise, the participant is not selected. In stage 2B, the participant
is asked another 100 questions. The number of correct answers to these questions is considered as
the second score. Now, the participant's behavioral score is added to the maximum of the initial
score and the second score. If this sum is greater than or equal to 85.5, the participant is selected.
Otherwise, the participant is not selected.
Write a Java program that determines whether a participant is selected based on the scores from the
experiment.
Programming requirements
In addition to the main method, you must write two methods, one for stage 2A calculation (name
it as stage2A) and the other for stage 2B calculation (name it as stage2B). Both methods should
be called from the main method.
In the main method, you must read the initial score from input. Make sure to validate the initial
score to be in the range 1 to 100(assume that the participant answers at least one question
correctly). If the user enters an incorrect value, force the user to enter the correct value (you
may need to use a while loop for this).
The method stage2A must be written as a non-void method which accepts the initial score as
input and must return the final score after adding the initial score and the behavioral score.
The behavioral score must be generated as a random integer. Use the following expression to
generate the behavioral score
Math.random ()**50.0+1.0;
Notice that the behavioral score is a double value and hence the final score is a double too.
The method stage2B must be written as a non-void method which accepts the initial score and
scan (the Scanner object that was created by the main method) as inputs and must return
the final score after adding the maximum of the initial score and the second score, with the
behavioral score. The second score must be read from the input (inside this method). The
second score must be validated in the same way as the initial score. The behavioral score must
be generated as a random integer as mentioned in the previous step.
Both methods stage2A and stage2B must print the initial score and the final score. Method
stage2B must also print the second score as well.
The main method must print the message indicating whether or not the participant is selected.
 Please make simple program were only on beginner loops and methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!