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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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