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
Which type of business is best for Juanita to start? a corporation, because she needs a large investment to get started a sole p
Vedmedyk [2.9K]

A sole proprietorship, because she will work alone from home a franchise

7 0
3 years ago
Read 2 more answers
These are Spealized graphics programs gor editing or modifying digital photographs
lisov135 [29]
They fall under the category of “Photo Editing Software” or “Image Manipulation Software”
8 0
2 years ago
What do presentation and word processing software have in common?
Elza [17]
D seems like the best answer because both Microsoft Word and Power Point can do that.

6 0
3 years ago
Read 2 more answers
A. True
ELEN [110]
False





-----------------------------------------------------
7 0
3 years ago
Please help i will give brainiest. Plus 30 points
ExtremeBDS [4]

Answer:

open ended

Explanation:

<em>Adaptive: </em>composition is a high-level game design framework for heightening physical empathy and the sensory experience of players with a focus on art and narrative-driven games and transmedia. so it is clearly not adaptive

<em>Cyclical: </em>is used to describe things that are regularly patterned or that occur in regular intervals. The root of cyclical is “cycle” which means movement in a circular fashion, or the circular fashion itself. Planets orbit the sun in cyclical patterns, the moon's phases are cyclical as well. we can keep cyclical in our option list but we still need to narrow it down more.

<em>linear:</em> A linear game follows a strict path for the player with little, if any, deviation. Basically, you traverse from stage 1 to stage 2 all the way to the final stage. Take, for example, Ghosts and Goblins or Magical Pop'n. A non-linear game deviates in some fashion, either throughout the whole game or just for a portion. obviously it is not linear because it is stage to stage which means that it has a end.

<em>open ended:</em> A game that is significantly nonlinear is sometimes described as being open-ended or a sandbox, though that term is used incorrectly in those cases, and is characterized by there being no "right way" of playing the game. Whether intentional or not, a common consequence of open-ended gameplay is emergent gameplay. this is very hard to understand if you do not have common sense or try to think things through too fast. we know that it is not linear and adaptive so we can clear those out of our choices. because cyclical uses a pattern and we are looking for something that gives us freedom it isnt that. so the answer has to be open ended

5 0
2 years ago
Other questions:
  • How to transfer audio files from computer to android?
    15·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is known as the
    14·1 answer
  • The byte-ordering scheme used by computers to store large integers in memory with the high-order byte at the lowest address is c
    12·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • Explain In your own words what a motherboard is and it’s functions?
    10·2 answers
  • . In Laissez-faire Styleof Group Leadership, Members of the group are not given help inactivity plans by the leader only when it
    11·1 answer
  • customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft Pow
    5·1 answer
  • &gt;What is the output of the following code:
    5·1 answer
  • Citations that are ______________________________ can be used to build a bibliography when needed. [Create and Modify Citation S
    15·1 answer
  • Write a multi-way if statement that compares the double variable pH with 7.0 and makes the following assignments to the bool var
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!