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
leonid [27]
4 years ago
6

Write a java program called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the numbe

r consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its digits are even (0, 2, 4, 6, 8). For example, the call allDigitsOdd(135319) returns true but allDigitsOdd(9145293) returns false.
Computers and Technology
1 answer:
Vlada [557]4 years ago
4 0

Answer:

public class Digits

{

   public static boolean allDigitsOdd(int num)

   {

       boolean flag=true;

       int rem;

       while(num>0)

       {

           rem=num%10;

           num=num/10;

           if(rem%2==0)    // if a even digit found immediately breaks out of loop

           {

               flag=false;

               break;

           }

       }

       return flag;     //returns result

   }

   public static void main(String args[])

   {

       System.out.println(allDigitsOdd(1375));    //returns true as all are odd digits

   }

}

OUTPUT :

true

Explanation:

Above program has 2 static methods inside a class Digits. Logic behind above function is that a number is divided by 10 until it is less than 0. Each time its remainder by 0 is checked if even immediately breaks out of the loop.

You might be interested in
Robert is working on an image as part of his school project. he has to do multiple edits on the file. what is a good practice fo
kenny6666 [7]
D, save the file in multiple formats at the beginning
8 0
3 years ago
An example of an "external brain" is:
mojhsa [17]

<u>Answer:</u>

<em>Organize things </em>

<u>Explanation</u>:

It is the <em>duty and power of external brain to Organize ideas</em>. Per day we may have plenty of works to be done. So we start thinking about <em>one by one and finally we try to sort out and organize how to perform, when to do and what is the first and last task etc. </em>

It is the external brain which is helping us to figure it out. But there are certain times where we <em>dump things together</em>, especially when there is an very important like marriage of our family member, where they <em>give lots of responsibilities. </em>

<em>At that time, we have very limited time to work out things and we dump our external brain. </em>

7 0
3 years ago
Read 2 more answers
4. An abstract data type is defined as _____.
marusya05 [52]

Answer: object that persist set of values and operations as behavior

Explanation: Abstract data types(ADT)are those object value which are dependent upon the collection of the values and collection of the operations.The organization of the data object is not specified in ADT but the operations that are to be carried out are defined in it.

The implementation individuality displayed by the ADT and hiding of the representation or design makes it abstract.

8 0
3 years ago
Enterprise information systems are also known as collaborative systems. true /false
ahrayia [7]

Enterprise information systems are also known as collaborative systems is a false statement.

<h3>What systems are also known as enterprise systems?</h3>

An enterprise system is known to be a term that is said to be also known as an enterprise resource planning (ERP) system.

Note this enterprise system is seen as a kind of a cross-functional information system that tends to give organization a form of larger scope as well as the coordination and the integration of some central business processes and aid them in the area of planning the resources of any given organization.

Note that Enterprise information systems are also known as collaborative systems is a false statement because it is an enterprise resource planning (ERP) system.

Learn more about Enterprise information systems from

brainly.com/question/14688347
#SPJ1

6 0
1 year ago
What is this morse code in text form, I know the binary form, I need to written English form. Thank you!
stiks02 [169]

Answer:

I put it in a converter and I think it is numbers

Translate a Message

Input:

.---- .---- ..--- ..--- .---- ..--- ..--- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- .---- ----- .---- .---- ..--- .---- .---- .---- .---- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- ..--- ----- .---- .---- ..--- ..--- .---- ..--- .---- ..--- ----- .---- .---- ..--- .---- .---- .---- .---- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- ..--- ----- .---- .---- ..--- ..--- .---- .---- .---- ..--- ----- .---- .---- ..--- .---- .---- .---- .---- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- .---- ----- .---- .---- ..--- ..--- .---- ..--- .---- .---- ----- .---- .---- ..--- .---- .---- .---- .---- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- .---- ----- .---- ..--- ..--- .---- .---- .---- ..--- .---- ----- .---- .---- ..--- .---- .---- .---- .---- .---- ----- .---- .---- ..--- ..--- .---- ..--- ..--- .---- ----- .---- ..--- ..--- .---- .---- .---- .---- ..---  

Output:

11221221011221221011211111011221222011221212011211111011221222011221112011211111011221221011221211011211111011221221012211121011211111011221221012211112

Explanation:

So I think you have numbers there hope this helped!

8 0
3 years ago
Other questions:
  • A hard drive that uses fde is often referred to as a(n) ____.
    11·1 answer
  • Write a function named enterNewPassword. This function takes no parameters. It prompts the user to enter a password until the en
    14·1 answer
  • Which of the following is not anadvantage of simulation?
    14·1 answer
  • When you set the position property for a block element to absolute, the browser?
    8·1 answer
  • What is the fastest typing speed ever recorded? Please be specific!
    13·1 answer
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • What is the difference between word processing software and presentation software​
    9·1 answer
  • 2.
    9·1 answer
  • Difference between software developer and software engineer.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!