1. A method named isPrime that takes an integer number and returns true if the integer is prime and false otherwise. The header of the method is as follows: public static boolean isPrime(int number) 2. A method named isEven that takes an integer number and returns true if the integer is even and false if it is odd. The header of the method is as follows: public static boolean isEven(int number)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Java, solve please sir and thank you 

Part-2: In your main class write the following methods:
1. A method named isPrime that takes an integer number and returns true if the integer is
prime and false otherwise.
The header of the method is as follows:
public static boolean isPrime(int number)
2. A method named isEven that takes an integer number and returns true if the integer is
even and false if it is odd.
The header of the method is as follows:
public static boolean isEven(int number)
3. A method named getFactors that takes an integer number and returns a String that
contains all factors of the integer, starting with 1 and ending with the integer itself, space
separated.
The header of the method is as follows:
public static String getFactors(int number)
For example, if the number 20 is passed to the method, it must return the String: "1 24
5 10 20"
4. A method named printIntegerInfo that takes an integer number, and prints information
about the integer to the console as follows:
Integer is
Value of integer must be printed in
Even/Odd
Invoke the isEven method to determine if the integer is Even or Odd.
Invoke the isPrime method to determine if the integer is prime or composite.
Invoke the getFactors method to get the factors of the integer.
Prime/Composite
Factors:
The header of the method is as follows:
public static void printIntegerInfo(int number)
5. In your main method, read an integer from the user then invoke the printIntegerInfo to
print information about the entered integer.
Transcribed Image Text:Part-2: In your main class write the following methods: 1. A method named isPrime that takes an integer number and returns true if the integer is prime and false otherwise. The header of the method is as follows: public static boolean isPrime(int number) 2. A method named isEven that takes an integer number and returns true if the integer is even and false if it is odd. The header of the method is as follows: public static boolean isEven(int number) 3. A method named getFactors that takes an integer number and returns a String that contains all factors of the integer, starting with 1 and ending with the integer itself, space separated. The header of the method is as follows: public static String getFactors(int number) For example, if the number 20 is passed to the method, it must return the String: "1 24 5 10 20" 4. A method named printIntegerInfo that takes an integer number, and prints information about the integer to the console as follows: Integer is Value of integer must be printed in Even/Odd Invoke the isEven method to determine if the integer is Even or Odd. Invoke the isPrime method to determine if the integer is prime or composite. Invoke the getFactors method to get the factors of the integer. Prime/Composite Factors: The header of the method is as follows: public static void printIntegerInfo(int number) 5. In your main method, read an integer from the user then invoke the printIntegerInfo to print information about the entered integer.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education