This was one of my College Assignment of Third semester. In this application the user is required to enter the number of times he/she wants to toss the coin and the code runs accordingly. To Quit the execution of the code the user should press -1.
- java.util package is imported in class name Coin_Toss.
- if, else is used to check the condition for the user's choice.
- An instance random() java class is used to generate
- while loop is used to check the condition to Quit.
- for loop with increment operator is to count heads & tails.
- String ,int and boolean data type are used in the code.
- Scanner class is used to take the number of input user want's to toss the coin.