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
RoseWind [281]
3 years ago
11

LAB: Convert to binary - methods

Computers and Technology
1 answer:
Georgia [21]3 years ago
8 0

Answer:

import java.util.Scanner;

public class Lab{

  public static String integerToReverseBinary(int number)

  {

      String binary = "";

      if(number == 0){

          return "0";

      }

      while(number > 0)

      {

          int remainder = number % 2;

          number = number / 2;

          binary += Integer.toString(remainder);

      }

      return binary;

  }

 

  public static String reverseString(String wordString)

  {

      String binaryString = "";

      int length = wordString.length();

      for(int i = length -1 ; i >= 0 ; i--)

      {

          binaryString += wordString.charAt(i);

      }

      return binaryString;

  }

 

Explanation:

In the java source code, the Lab class is defined which has two methods, 'reverseString' and 'integerToReverseBinary'. The latter gets the argument from the former and reverses the content of its string value, then returns the new string value. The former gets the integer value and converts it to its binary equivalence for which are converted to strings and returned.

You might be interested in
How much mobile data does maps use
aleksandrvk [35]
Open up setting, cellular option, and you can view the amount of mobile data each of your apps take
5 0
4 years ago
A "slideument" is:
Sophie [7]

Answer:

c. An electronic slide that tries to function as both a presentation visual and a printed document

Explanation:

Slideument combines both text and visual aids to form a document that can be fully understood by readers without the use of speakers when presenting these documents. It is a presentation with information containing visual aids and presented in form of slide deck so that it can be easily understood by readers.

8 0
3 years ago
What does "ttyt" stand for?
EastWind [94]
TTYT stands for "talk to you tomorrow".
6 0
4 years ago
Read 2 more answers
Which discipline would be most likely to study and experiment with new technologies like artificial intelligence? software engin
SashulF [63]

Answer:

Information Technology

Explanation:

The discipline that would obtain the most benefit from new technologies such as Artificial Intelligence would be Information Technology. The amount of information that exists on the internet is staggering. Artificial Intelligence works by obtaining as much information as possible, learning from the data gathered, and manipulating the data as needed. This allows Information Technology developers to find patterns in data sets, create virtual assistants, automate tasks, find connections in the data, etc. Therefore, bringing a vast number of benefits from studying and experimenting with such technology.

4 0
3 years ago
Which command would you use to have a workstation stop using an ip address?
Arada [10]
SSH and Telnet!!!! :)
7 0
3 years ago
Other questions:
  • Yeah i just purchase a new laptop with built-in 802.11 wireless and bluetooth capabilities when you boot into windows you do not
    12·1 answer
  • Why is monitoring email, voice mail, and computer files considered legal?
    6·1 answer
  • ______ is the primary and dominant cryptographic authentication and encryption framework for security development within the TCP
    12·2 answers
  • What were second generation languages that required detailed knowledge of the computer's hardware and a lot of spare time to wri
    11·1 answer
  • Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a directory or a file, and if
    14·1 answer
  • Which Tab provides the command to add a hyperlink to a document?
    11·2 answers
  • Which graphic file format is used for commercial purposes.
    10·1 answer
  • A typical day in programming and software development would involve
    7·1 answer
  • Question 1 (1 point)
    9·2 answers
  • Computers are used because they :
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!