Q1. Write a String method called "isEven" that takes n as parameter of integer type, and returns "even" if n is even and returns "odd" otherwise. Test your method using suitable (10%) data in the main method. Q2. Write a value-returning method "isVowel" that returns the value true if a given character is a vowel, and otherwise returns false. In the main method, take characters form the user until he enters "#" and print "vowel" or "not vowel" according to the method output. (25%)
Q1. Write a String method called "isEven" that takes n as parameter of integer type, and returns "even" if n is even and returns "odd" otherwise. Test your method using suitable (10%) data in the main method. Q2. Write a value-returning method "isVowel" that returns the value true if a given character is a vowel, and otherwise returns false. In the main method, take characters form the user until he enters "#" and print "vowel" or "not vowel" according to the method output. (25%)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Write a Java program

Transcribed Image Text:Q1. Write a String method called "isEven" that takes n as parameter of integer type, and
returns “even" if n is even and returns "odd" otherwise. Test your method using suitable
(10%)
data in the main method.
Q2. Write a value-returning method "isVowel" that returns the value true if a given
character is a vowel, and otherwise returns false.
In the main method, take characters form the user until he enters "#" and print “vowel" or
"not vowel" according to the method output.
(25%)
Q3. Write a method “checkPrime" to check whether a number is a prime number or not,
the method takes an integer argument and returns a true if the argument was prime and
false otherwise.
In the main method, repeat checking for any number entered by the user, until he enters
0.
Hint: Use the modulo operator % to find the remainder from division.
(25%)
Example output:
Please type a number: 7
The number is prime.
Please type a number: 2
The number is not prime.
Please type a number: 0
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY