Write a math quiz and coin flipping program using


Write a math quiz and coin flipping program using sub-methods instead of having the process code within the main method.

Assignment Requirements

Write out two sub-methods, one representing the math quiz and the other the coin flipper.

The math quiz sub-method should adhere to the following requirements:
Boolean return type
One int parameter

The sub-method will use the supplied int parameter to determine which quiz to administer to the user (1 for addition, 2 for subtraction, 3 for multiplication, 4 for division). The program will then create a quiz with two randomized, single digitnumbers with the operation requested by the user. If the user answers the question correctly, the program will return a Boolean of TRUE, otherwise it will return a Boolean of FALSE.
The coin flipper sub-method should adhere to the following requirements:
Void return type
One int parameter

The sub-method will take the int parameter to determine the number of times to flip the coin. The sub-method will then output the number of heads and tails from the flip(s).

In the main method of your program, make the following calls to the two sub-methods:

Call the math quiz using the following parameter (1)
Answer the quiz correctly
Output the return
Call the math quiz using the following parameter (3)
Answer the quiz incorrectly
Output the return

Call the coin flipper using the following parameters (100)

Call the coin flipper using the following parameters (10000)

The modifiers of your sub-methods should be public static so that they are visible and accessible from the main. You may name your sub-methods whatever you like.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a math quiz and coin flipping program using
Reference No:- TGS02386157

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)