Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:30, donmak3833
Agood flowchart alludes to both the inputs and outputs you will need to receive and give to the user. true or false?
Answers: 3
image
Computers and Technology, 23.06.2019 12:20, jshhs
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
image
Computers and Technology, 23.06.2019 21:40, gaby06
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
image
Computers and Technology, 24.06.2019 02:20, Jonny13Diaz
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
Do you know the correct answer?
In Java, write a AllDigitsOdd program that has a method called allDigitsOdd that takes an integer an...

Questions in other subjects:

Konu
Mathematics, 13.05.2021 05:50