207k views
4 votes
Convert this code into Java:

ELEMENTS = [1,663,8,2,4,1,22,66,20,122]
Loop I from 0 to 8
Loop K from 0 to (8 - I)
If ELEMENTS[K] > ELEMENTS[K+1] then
TEMP = ELEMENTS[k]
ELEMENTS[K] = ELEMENTS [K +1]
ELEMENTS[K + 1] = TEMP
End if
End loop
End loop
Output “Sorted Elements”
Loop E from 0 to 9
Output ELEMENTS [E]
End loop

User Dontexist
by
4.1k points

1 Answer

5 votes

Answer:

Convert text into binary. Computers store all characters as numbers stored as binary data. Binary code uses the digits of 0 and 1 (binary numbers) to represent computer instructions or text. Each instruction or symbol gets a bit string assignment. The strings can correspond to instructions, letters, or symbols. In computing, these codes are used for encoding data.

This base-2 or binary numeral system is used in mathematics and computer science. The system represents values using just the two symbols. The values in the binary systems are typically called binary numbers.

In digital electronics and more specifically in digital electronic circuits that use logic gates (with values of 0 and 1), computers use the binary system internally. Computer based devices use the binary system as well with this including mobile phones.

Step-by-step explanation:

User Jithin Jude
by
3.8k points