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]
2 years ago
11

LAB: Convert to binary - methods

Computers and Technology
1 answer:
Georgia [21]2 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
Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
inna [77]

Answer:

A. days of vacation time left

B. days of school left in the year

D. years of service someone performed

Explanation:

The NETWORKDAYS function is a built in excel function which makes it easy to calculate the number of days between two specified dates the start date and the end date, this function when applied excludes weekends from the days calculated and one has the opportunity of specifying certain holidays. With this function. The number of days till vacation, the number school days left. The NETWORKDAYS is a very versatile function.

7 0
2 years ago
Winners announced tomorrow when I check results ngl I gtg to sleep soon I should see a lot of people tomorrow ^^
kobusy [5.1K]

i am sup by the way. so im guessing i win?

4 0
3 years ago
Three periods after a menu item (...) mean that clicking that command will open
erastovalidia [21]

I think its B.) A dialog box


7 0
3 years ago
Read 2 more answers
What are some differences between CUI and GUI ?
ollegr [7]

Answer:

Even though both are interfaces and serve its purpose of attempting to run the strategies, their components as well as the manipulate they will get from the patient differ.

Explanation:

CUI (Character User Interface) :-

  • It's a sort of user interface that only uses binary data and pseudographics for interface-output and data sessions.
  • That's characterized by low availability for operating systems I / O resources (act with integrity) and high speed with a display of data.

GUI (Graphical User Interface (GUI):-

  • Using graphical elements such as windows, icons, menus helps the user to communicate with the program.
  • It is a kind of user interface along which people interact with electronic equipment through characterizations of visual indicators.
3 0
3 years ago
An attacker is preparing to perform what type of attack when the target vulnerabilities include headers and payloads of specific
kari74 [83]

An attacker is preparing to perform what Application attack  when the target vulnerabilities include headers and payloads of specific application protocols.

<h3>What Is an Application Attack?</h3>

An application attack is known to be a type of system attack which is made up of cyber criminals that is said to have access to any unauthorized points.

Note that this kind of Attackers are  the ones that start by  looking at the application layer, and then looking for any kind of application vulnerabilities that is found within the code.

Learn more about vulnerabilities from

brainly.com/question/25633298

3 0
2 years ago
Other questions:
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • What is the name of a popular high-level computer programming and scripting language that is the name of a snake?
    10·1 answer
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • An installed theme can be applied by clicking on a theme in the themes group on the ____ tab.
    7·2 answers
  • What type of memory or storage device is prone to losing data if the power goes out?
    5·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • What is the Slide Sorter View used for?
    12·2 answers
  • (I WILL GIVE BRAINLIEST) Which steps will delete an appointment?
    8·1 answer
  • Employers can use spyware to track program usage by employees.
    12·1 answer
  • I watched an ad but the im button done is no where in sight, has anyone else experienced this recently. it was fine a few days a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!