This is a MidTerm Example: Write a static method called Prob…
Questions
This is а MidTerm Exаmple: Write а static methоd called PrоblemSоlver that takes a console scanner and an integer count as parameters and that makes up count multiplication problems for the user to solve. Each multiplication problem involves randomly choosing two numbers that are each between 1 and 5 inclusive with equal probability. The user should be prompted for the answer and should be told whether their answer was correct or incorrect. The method should also report the number of problems solved correctly and the number of problems given. For example, if the following calls are made: Scanner console = new Scanner(System.in);ProblemSolver(console, 4); We would expect interaction like the following:9 * 5 =? 45correct8 * 8 =? 65incorrect...the answer was 643 * 9 =? 27correct2 * 3 =? 7incorrect...the answer was 62 of 4 correct In this log, the user entered 4 answers (45, 65, 27, 7). All other text was produced as output by the method. Notice that there is a final line of output indicating the overall results. Your method must exactly reproduce the format of this log.