Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 - directMethods.java elearn.uta.edu SIDEMEN DRUN Course Materials... https://elearn.ut... Favorites directMethods.ja... The top and bot... Chegg Study G... Problem 3-Write.. Chegg Problem 2-Write methods
Problem 2 - directMethods.java
elearn.uta.edu SIDEMEN DRUN Course Materials... https://elearn.ut... Favorites directMethods.ja... The top and bot... Chegg Study G... Problem 3-Write.. Chegg Problem 2-Write methods Submit a program called directMethods.java Create a method called leapYear() that takes an integer (a year) and returns true if the year is leap year and false if it is not. For example, a line of code like System.out.printin(leapYear(2020)); in the main method should output true to screen 1. 2. Create a method called threeNums() that takes a String parameter of three integers, separated by a dash -. The method should return true if they are in increasing order (from left to right) and false otherwise. For example, a line of code like System.out.printin(threeNums("10-20-40")); in the main method should output true to screen. 3. Create a method called printOut() that takes an integer parameter, a char and a String and prints out a box using the given char. The top and bottom part of the box should have as many chars as the integer parameter given and the sides of the box should be half of the integer parameter given. The String given should be printed in the middle of the box. For example, a line of code like printout(10, Hello"); in the main method should output to screen the box given below. If the String given is longer than the integer given or the integer given is not an even number, "Can't print this:("should be output to screen. Hello Create a main method using these methods. Your main method should only contain three lines System.out.printin(leapYear(2020)); System.out.println(threeNums("10-20-40")); printOut(10,'", "Hello"): 4
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