Write a method called hasAnOddDigit that returns whether a given positive integer has at least one digit
Question:
Write a method called hasAnOddDigit that returns whether a given positive integer has at least one 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. For example, the call hasAnOddDigit(4822116) should return true and hasAnOddDigit(2448) should return false.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 63% (11 reviews)
public static boolean hasAno...View the full answer
Answered By
JAPHETH KOGEI
Hi there. I'm here to assist you to score the highest marks on your assignments and homework. My areas of specialisation are:
Auditing, Financial Accounting, Macroeconomics, Monetary-economics, Business-administration, Advanced-accounting, Corporate Finance, Professional-accounting-ethics, Corporate governance, Financial-risk-analysis, Financial-budgeting, Corporate-social-responsibility, Statistics, Business management, logic, Critical thinking,
So, I look forward to helping you solve your academic problem.
I enjoy teaching and tutoring university and high school students. During my free time, I also read books on motivation, leadership, comedy, emotional intelligence, critical thinking, nature, human nature, innovation, persuasion, performance, negotiations, goals, power, time management, wealth, debates, sales, and finance. Additionally, I am a panellist on an FM radio program on Sunday mornings where we discuss current affairs.
I travel three times a year either to the USA, Europe and around Africa.
As a university student in the USA, I enjoyed interacting with people from different cultures and ethnic groups. Together with friends, we travelled widely in the USA and in Europe (UK, France, Denmark, Germany, Turkey, etc).
So, I look forward to tutoring you. I believe that it will be exciting to meet them.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted:
Students also viewed these Computer science questions
-
True or false: Every matrix has at least one singular value.
-
Write a method called isAllVowels that returns whether a string consists entirely of vowels (a, e, i, o, or u, case-insensitively). If and only if every character of the string is a vowel, your...
-
Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its...
-
Joel purchased 100 shares of stock for $20 per share. During the year, he received dividend cheques amounting to $150. After three years, Joel sold the stock for $32 per share. What was his holding...
-
An automobile engine consumes fuel at a rate of 22 L/h and delivers 55 kW of power to the wheels. If the fuel has a heating value of 44,000 kJ/kg and a density of 0.8 g/cm3, determine the efficiency...
-
What terminates input into an integer?
-
An incompressible fluid flows along a \(0.20-\mathrm{m}\)-diameter pipe with a uniform velocity of \(3 \mathrm{~m} / \mathrm{s}\). If the pressure drop between the upstream and downstream sections of...
-
The merchandise inventory was destroyed by fire on August 19. The following data were obtained from the accounting records: a. Estimate the cost of the merchandise destroyed. b. Briefly describe the...
-
Janice has been invited to appear on a home improvement show for the remodel of her summer house in Maine. Janice asks Mary to wallpaper her house in anticipation of the home improvement, and...
-
Suppose you are an American citizen living in Japan. You just lost your job with an electronics company that merged with a firm in Singapore. You would like to stay in Japan and are thinking about...
-
Write a piece of code that prompts the user for a number and then prints a different message depending on whether the number was an integer or a real number. Here are two sample dialogues: Type a...
-
The following method attempts to return the median (middle) of three integer values, but it contains logic errors. In what cases does the method return an incorrect result? How can the code be fixed?...
-
When a fair die is rolled many times, the outcomes of 1, 2, 3, 4, 5, and 6 are equally likely, so the mean of the outcomes should be 3.5. The author drilled holes into a die and loaded it by...
-
Identify Honeywells portfolio of businesses, which can be found at its website (www.honeywell.com). In how many different industries is Honeywell involved? Would you describe Honeywell as a related...
-
An insulated cardboard box is to be designed to transport a labile vaccine product that has to be kept at 78C in areas where lowtemperature refrigeration is not widely available. The box is a cube...
-
The design of an astronauts glove requires that you select the thickness of insulation needed to keep the skin surface temperature at 25C for long periods of time when the outer surface of the...
-
Serpe has reported on the development of smart windows, where the gap between two glass panes is filled with an aqueous solution containing hydrogel particles made of poly(#1- isopropylacrylamide) or...
-
Consider a slab-shaped graphite electrode that is 3 ft long, 3 in. wide, and 0.5 in. thick. A voltage difference of 24 V is applied across the 3- ft length. Assuming that the temperature is uniform...
-
A 2.00-F and a 4.00-F capacitor are connected to a 60.0-V battery. What is the total charge supplied to the capacitors when they are wired (a) In parallel and (b) In series with each other?
-
Open Text Corporation provides a suite of business information software products. Exhibit 10-9 contains Note 10 from the companys 2013 annual report detailing long-term debt. Required: a. Open Text...
-
Karen has a new way to do path compression in a tree-based union/find partition data structure starting at a position p. She puts all the positions that are on the path from p to the root in a set S....
-
Suppose we are given a directed graph G with n vertices, and let M be the nÃn adjacency matrix corresponding to G. a. Let the product of M with itself (M 2 ) be defined, for 1¤i, j...
-
Inside the Castle of Asymptopia there is a maze, and along each corridor of the maze there is a bag of gold coins. The amount of gold in each bag varies. A noble knight, named Sir Paul, will be given...
-
Many American car manufacturers are located in the Southeast. Due to hurricane season, the Southeast has gotten a significant amount of rain, causing vast flooding. How is the supply of cars impacted?
-
Suppose that the cost in dollars for a weekly production of x tons of sugar is given by the following function (a) Find the marginal cost. 1 C(x) = x+3x+200. (b) Find the cost and marginal cost when...
-
16. An IEEE standard 32-bit floating point number is N = -15 x 2E-127 x 1.F, where S is the sign bit, F is the fractional mantissa, and E the biased exponent. a. Convert the decimal number 123.5 into...
Study smarter with the SolutionInn App