
Define a Static method 'max' with return type as 'int' in class 'ProblemSolution' that take two numbers with type 'int'. Inside the 'max' method, compare the two numbers and return the maximum of the two numbers.
Then, inside the 'main' method.
Define two 'int' type numbers; the first number (num1) is equal to 5 and the second number (num2) is equal to 2.
At the next line, call the 'max' method where its parameter input are the two numbers above, and assign the result of the method to the variable num3 (type 'int').
Finally, on the next line, print out -> "The maximum of " + num1 + " and " + num2 + " is " + num3
Output
The maximum of 5 and 2 is 5
Where,
There must be space between all the words and numbers.
There should not any space after the last number

![1- import java.util.*;
2
3 public class ProblemSolution {
4
5 ▼
/* Define max method here */
6
7
8
//Main method
9 ▼
public static void main(String[] args) {
10
11 ▼
12
Define the two variables and call the max method here.
13
Afterward, print out the result following the phrase given
14
by the question.
15
16
}
17
}
18](https://content.bartleby.com/qna-images/question/cab43375-9d8e-42d5-87b9-87b3ba8c37de/0e8a360d-c99b-4923-ad49-9ca65f85b6cb/7bmf1r9_thumbnail.png)

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

- 53. Write a class with two instance variables, representing an old password and a new password. Write a recursive method that returns the number of places where the two passwords have different characters. The passwords can have different lengths. Write another, nonrecursive method returning whether the two passwords are sufficiently different. The method takes an int parameter indicating the minimum number of differences that qualify the passwords as being sufficiently different. Your program should include a client class to test your class.arrow_forwardCreate another class DayProg and write the main() method to display the following: Today is 2022-02-03. The Daylight-Saving Time start day is 2022-03-13. There are 38 days until the Daylight-Saving Time start day. The date after 19 days is: Year : 2022 Month: 2 Day : 22arrow_forwardCan you help me pleasearrow_forward
- You are responsible for adding the appropriate testing code to your main. a. The getValedictorian method returns the valedictorian of the class, that is the student with the highest grade point average. Implement this new method. b. The getHonorsPercent method returns the percentage of students in the class who are in the honors program. Use 3.75 as the cutoff GPA. Implement this method. Also print the list of students, by using the isHonor method, in the Honors program. c. An alternate implementation for the School class is being considered, in which the students are stored in an ArrayList instead of an array. Show how the declaration of the data field students would look in this alternate design. MAIN CLASS: import java.util.ArrayList; public class Main { public static void main(String[] args) { System.out.println("Unit07Project2 by Your Name"); System.out.println(); int size = 10; School onw = new School(size); /* Add the code…arrow_forwardGiven main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:wins / (wins + losses). Note: Use casting to prevent integer division. For class method printStanding(), output the win percentage of the team with two digits after the decimal point and whether the team has a winning or losing average. A team has a winning average if the win percentage is 0.5 or greater. Ex: If the input is: Ravens 13 3 where Ravens is the team's name, 13 is the number of team wins, and 3 is the number of team losses, the output is: Win percentage: 0.81 Congratulations, Team Ravens has a winning average! Ex: If the input is: Angels 80 82 the output is: Win percentage: 0.49 Team Angels has a losing average.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





