1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dominik [7]
3 years ago
11

Write the function isOdd()that takes a single parameter n1as input and returns the Boolean value Trueif n is an odd integer and

Falseotherwise. Note that the parameter may be any type, but the return value is False whenever it is not an int.
Computers and Technology
1 answer:
dimaraw [331]3 years ago
5 0

Answer:

   public static boolean isOdd(int n1){

       if (n1%2==0){

           System.out.println("The number is even");

           return true;

       }

       else{

           System.out.println("The number is odd");

           return false;

       }

   }

Explanation:

Using Java program language;

Declare the method fix the return type to be boolean

use the modulo operator (%) to check if even since (n%evenNo is equal to 0)

return true is even or false if not

See a complete program with user prompt using the scanner class below

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("Enter any Integer Number");

       int n = in.nextInt();

       isOdd(n);

   }

   public static boolean isOdd(int n1){

       if (n1%2==0){

           System.out.println("The number is even");

           return true;

       }

       else{

           System.out.println("The number is odd");

           return false;

       }

   }

}

You might be interested in
Ima go to sleep but I ask a favor can u guys go on eBay Amazon and find the cheapest pre bilt that is actually good
katrin2010 [14]

Explanation:

what do specifically want to buy??

8 0
3 years ago
Read 2 more answers
Can anyone help my please
Makovka662 [10]

order: soil, plant seeds, water, seedling, corn plant

4 0
2 years ago
Read 2 more answers
A file that is 242 megabytes is being downloaded. if the download is 15.4% complete, how many megabytes have been downloaded? ro
Lunna [17]
37.26 megabytes have been downloaded
5 0
3 years ago
When you set code inside other code, in an orderly fashion, it is called:
V125BC [204]

Answer:

It is called Nesting

Explanation:

or in this case B

5 0
3 years ago
Lori wants to set up a SOHO network in her apartment. The apartment comes with a Gigabit Ethernet network already installed. Lor
Yanka [14]

Connection to the gigabit ethernet network must be done with Cat6 Cable. Using the wireless ethernet router as the network device and connecting the cable to the printer must be done with Cat5e Cable.

We can arrive at this answer because:

  • The Cat6 Cable will be responsible for establishing a bridge between the gigabyte Ethernet and the network device, allowing data delivery to be made between the two systems.
  • This connection must be made with a wireless device, to keep it more stabilized and it needs, mainly, for the notebook to receive the internet signal. This will be done using the wireless ethernet router.
  • The printer needs a softer, less rigid connection, so a Cat5e cable will be a convenient option.

In this case, we can see that using these devices will allow Lori to have a more stable and efficient connection to meet her needs.

More information on network connection at the link:

brainly.com/question/8118353

5 0
2 years ago
Read 2 more answers
Other questions:
  • Bullets in a text box will do which of the following?
    9·1 answer
  • Why would you set up a workbook to be shared if you are the only one using the workbook?
    7·1 answer
  • Assuming that each of the resistors in the circuit shown in the figure above has a resistance value of 100 k ohms, what will be
    11·2 answers
  • ____ software is rights-protection software used to control the use of a work.
    9·1 answer
  • What is the smartest person ever
    15·2 answers
  • 1. Insert a Header that has the following in excel​
    14·1 answer
  • Describe how being a global citizen in the world of advanced technology can be beneficial to your success in meeting your person
    13·1 answer
  • Write a static method called split that takes an ArrayList of integer values as a parameter and that replaces each value in the
    12·1 answer
  • Which of the following statements are true concerning abstraction and refinement? Select 3 options:
    14·1 answer
  • .....is used to save project in Visual basic .net from file menu
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!