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
Karo-lina-s [1.5K]
3 years ago
7

Write a method named decimalToBinary that accepts an integer as a parameter and returns an integer whose digits look like that n

umber's representation in binary (base-2). For example, the call of decimalToBinary(43) should return 101011. Constraints: Do not use a string in your solution. Also do not use any built-in base conversion methods like Integer.toString .
Computers and Technology
1 answer:
zmey [24]3 years ago
7 0

Answer:

In Java:

public static int decimalToBinary(int decimal){

int binary = 0; // initial value

int currUnitPlace = 1; // working location

while(decimal > 0) {

// put remainder in current unit place

binary += currUnitPlace * (decimal%2);

decimal /= 2; // move to next bit

currUnitPlace *= 10; // move unit place

}

return binary;

}

You might be interested in
After you have figured out your storyline, what should be the next thing to
seraphim [82]
Answer: 2

A storyline figured out means you should already know the plot, setting, conflict, theme and characters (character development)
7 0
3 years ago
Read 2 more answers
a password to a certain database consists of digits that cannot be repeated. if the password is known to consist of at least 8 d
BaLLatris [955]

Answer:

\frac{10!}{2}mins

Explanation:

12 seconds to try one combination will be equivalent to  \frac{1}{12}\times 60 = \frac{1}{5} \ mins

Password contain at least 8 digit i.e. password can contain 8, 9, 10 digit.

Password cannot contain more than 10 digit because it will give room for repetition which it is clearly stated that digit cannot be repeated.

Possible digit that can be used: 9,8,7,6,5,4,3,2,1,0.

Total number of passwords combination possible for each position in 8 digit.

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3. Total number of passwords combination possible in 8 digit is equivalent to \frac{10!}{2}.

Total number of passwords combination possible for each position in 9 digit.  

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3, 9th position = 2. Total number of passwords combination possible in 9 digit is equivalent to \frac{10!}{1}.

Total number of passwords combination possible for each position in 10 digit.

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3, 9th position = 2, 10th position = 1.  Total number of passwords combination possible in 10 digit is equivalent to 10!.

Adding them up and multiplying by  \frac{1}{5} \ mins  to get the total number of time needed to guarantee access to database =  [\frac{10!}{2}\times\ \frac{10!}{1} \times 10!] \frac{1}{5}\ mins = \frac{10!}{2}

7 0
4 years ago
When delivering 2023 murano, demonstrate how to turn the driver assistance technologies on or off using ________.
IgorC [24]

In the case above, it is by using

  • The Driving Aids screen that is shown in the Advanced Drive-Assist Display
  • The Driver Assistance menu  seen under Settings in the Advanced Drive-Assist Display.

<h3>What are the packages is added for Murano?</h3>

Murano is known to adds a lot of feature such as new Midnight Edition package, and blackout front grille, amidst others.

Note that In the case above, it is by using

  • The Driving Aids screen that is shown in the Advanced Drive-Assist Display
  • The Driver Assistance menu  seen under Settings in the Advanced Drive-Assist Display.

Learn more about Cars from

brainly.com/question/124419

#SPJ1

3 0
2 years ago
List out any five input and output devideos​
monitta
Asks issiaksmskskskejehshsjsjsnsdkxxkdnsabhwssns
4 0
3 years ago
Ummm, I hate to interrupt your day, but does anyone know where Mitch72 is????? Because he hasn't talked in a week, and he hasn't
Anettt [7]

Answer:

sorry but no

Explanation:

4 0
3 years ago
Other questions:
  • Suppose your boss has asked you to write a letter to a client about a problem with their order. What format of writing would you
    9·1 answer
  • As a digital forensics examiner, it’s a good idea to build a list of references for information on privacy laws in other countri
    13·1 answer
  • Mark for review (Will be highlighted on the review page) 11. A feature in Excel that allows you to graphically display in a sing
    10·1 answer
  • How do you optimize a website using JavaScript?
    10·1 answer
  • Explain with a few sentences and using the terms sequencing, selections and loops how they
    9·1 answer
  • For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
    12·1 answer
  • Which of these is NOT a reason for an IP Address?
    15·2 answers
  • Is it safe for me to use normal glue to stick things on my laptop like stickers or pics?
    12·2 answers
  • Write a C program that reads two hexadecimal values from the keyboard and then stores the two values into two variables of type
    15·1 answer
  • Why do we need to know the different Networking Devices?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!