Write a math quiz and coin flipping program

Assignment Help JAVA Programming
Reference no: EM131590615

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.

Reference no: EM131590615

Questions Cloud

Prepare the income statement and statement of owners equity : You are the Senior Accountant for September Oaks Inc. Prepare the income statement, the statement of owner's equity, and the balance sheet
What is the weight of the horse in kn : A raft is 3.9 m wide and 6.2 m long. When a horse is loaded onto the raft, it sinks 4.0 cm deeper into the water. What is the weight of the horse in kN?
Describe the history and development of forensic science : Identify the many roles of the forensic science expert as is they relate to the forensic science disciplines
Identify gaps between best practices and current policies : Analyze current recruitment and retention policies to identify gaps between best practices and current policies.
Write a math quiz and coin flipping program : Write a math quiz and coin flipping program using sub-methods instead of having the process code within the main method - Write out two sub-methods
Pressure exerted on the floor : Find the pressure exerted on the floor by each leg of the chair, assuming the weight is evenly distributed.
Define the different approaches to juvenile justice : What do you believe can be done about reconciling the different approaches to juvenile justice
Represent for a velocity versus time graph : What does a positive and negative slope represent for a velocity versus time graph?
Discuss what was the basis for the officer asking the driver : What was the basis for the officer asking the driver to exit his vehicle. Does he need a basis to do so. Why or why not

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a postfixcalculator class

Write a PostfixCalculator class - create multiple implementations of the operator interface in order to do this - You should have two private member variables

  What is a nested inner class

What is a nested inner class? What special privileges does a nested inner class have? Give an example of how you declare a nested inner class

  Compute a java programming writing a number converter

Compute a Java Programming - Writing a number converter. Surgeons have a very tough schedule throughout the day to deal with patients, perform surgeries, visit wards, and attend meetings among others.

  Why the given is not running properly

Purpose: To process messages similar to TtT tweets and pull out information form the text, manipulate it, and print it out on the screen

  Write down the business needs for a computer program and

write the business requirements for a computer program and identify which entities are to be modeled using object

  Write the methods displaymenu and soundspeed

Write the method DisplayMenu and SoundSpeed- Make sure that distance is a positive number.

  What does this sequence of statements print

What is wrong with the following variable declarations - What does this sequence of statements print

  Java program on eclipse

Using a while( true ) loop,and using the upper case alphabeth from Z to A,print the lower case alphabeth and its corresponding ascii values.You must terminate/exit/break this loop once you process the last letter (A).

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Demonstrate in the program how two threads can

Demonstrate in the program how two threads can, sometimes, invoke atomic() concurrently. Create a second version of the program in which the two threads cannot invoke atomic concurrently.

  Write an object-oriented java program to manipulate data

I want a simple java solution matching all the specifications in the document. The java program has to be made using Eclipseversion 4.2.1.

  Create an array of size n and fill it

Sketch a high level design of what you want to implement using the UML notation. At the very least, you should have a use case diagram, class diagram and a sequence diagram.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd