Question: How would i go about using a method to return something true or false a certain percentage of the time? For example, if I have:

 How would i go about using a method to return something

How would i go about using a method to return something true or false a certain percentage of the time? For example, if I have: public boolean percentageOfTimes(){ boolean x; Double percentage = 0.80; I want the method to return x as true 80 percent of the time and false 20 percent of the time

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!