Write a method1 that returns whether a given positive integer has at least one odd digit whose value is odd. Return true if the number has at least one odd digit and false if none of its digits are odd. method1 (123) returns true method1 (248) returns false method1 (1111) returns true method1 (22) returns false

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Java Program!
Write a method1 that returns whether a given positive integer has at least
one odd digit whose value is odd. Return true if the number has at least
one odd digit and false if none of its digits are odd.
method1 (123) returns true
method1 (248) returns false
method1 (1111) returns true
method1 (22) returns false
Transcribed Image Text:Write a method1 that returns whether a given positive integer has at least one odd digit whose value is odd. Return true if the number has at least one odd digit and false if none of its digits are odd. method1 (123) returns true method1 (248) returns false method1 (1111) returns true method1 (22) returns false
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT