Question
In Java, Write a program that: -requests from the user the dimensions of a two dimensional array. -creates a two-dimensional array. -calls a method booleanFull
In Java, Write a program that:
-requests from the user the dimensions of a two dimensional array.
-creates a two-dimensional array.
-calls a method booleanFull that randomly fills the two-dimensional array with either true or false values in each cell.
-calls a second method called calcPercent that returns the percentage of elements in the two dimensional array that are true.
-prints out the array and on the next line prints out the percent of cells in the array that have the value true formatted to two decimal places.
-create a Random object and use the method nextBoolean() in the booleanFull method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started