subject

In Java, write a AllDigitsOdd program that has a method called allDigitsOdd that takes an integer and returns whether every digit of an integer is odd (boolean).
returns true if the integer consists entirely of odd digits (1,3,5,7,9)
returns false if any of its digits are even (0,2,4,6,8)
Consider the use of mod (%).
You should complete the method with integers only. You should not convert the integer to a String
Method call examples:
allDigitsOdd(135319) would return true
allDigitsOdd(-9145293) would return false
Your main method should:

//Prompt the user for an integer.
//You can assume the user always types an integer.
//Then print whether or not the number has all odd digits.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, jcazares3558
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, Knownothing
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
image
Computers and Technology, 23.06.2019 09:00, Riddledjam44623
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
You know the right answer?
In Java, write a AllDigitsOdd program that has a method called allDigitsOdd that takes an integer an...

Questions in other subjects:

Konu
Mathematics, 02.12.2019 01:31
Konu
Mathematics, 02.12.2019 01:31