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
asambeis [7]
3 years ago
7

Write a Java program that prompts for integers and displays them in binary. Sample output: Do you want to start(Y/N): y Enter an

integer and I will convert it to binary code: 16 You entered 16. 16 in binary is 10000. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 123 You entered 123. 123 in binary is 1111011. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 359 You entered 359. 359 in binary is 101100111. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 1024 You entered 1024. 1024 in binary is 10000000000. Do you want to continue(Y/N): n
Computers and Technology
1 answer:
klasskru [66]3 years ago
8 0

Answer:

Explanation:

The following code is written in Java and creates a loop that cycles the same prompt until the user states no. While the loop runs it asks the user for an integer value and returns the binary code of that value

public static void main(String[] args) {

               Scanner in = new Scanner(System.in);

               boolean continueLoop = true;

               while (continueLoop) {

                   System.out.println("Would you like to continue? Y/N");

                   String answer = in.nextLine().toLowerCase();

                   if (answer.equals("y")) {

                       System.out.println("Enter int value: ");

                       int number = in.nextInt();

                       System.out.println("Integer: "+number);

                       System.out.println("Binary = " + Integer.toBinaryString(number));

                   } else if (answer.equals("n")){

                       System.out.println("breaking");

                       break;

                   }

               }

       }

You might be interested in
At which stage should James, a website designer, gather information about the website he wants to create, and at which stage sho
viva [34]
<h2>Answer: James should gather information in the <u><em>Learning</em></u> phase and begin the site’s coding in the <u><em>Development</em></u> phase.</h2>

8 0
3 years ago
What. is. a. gradient?​
pashok25 [27]

Answer:

Gradient, in mathematics, a differential operator applied to a three-dimensional vector-valued function to yield a vector whose three components are the partial derivatives of the function with respect to its three variables. The symbol for gradient is ∇.

Explanation:

4 0
3 years ago
Read 2 more answers
True / False
Tju [1.3M]

Answer:

TRUE, The PC is always incremented by the same amount in fixed-length instruction set architectures.

Explanation:

Its TRUE that Program Counter ( PC ) is always incremented by the same amount in fixed - length instruction set architectures ( fixed length ISA) . As the instruction set length is fixed in fixed - length instruction set architectures, the Program Counter to fetch the next instruction set it has to be incremented by fixed length. This fixed length depends on the hardware of the architecture (the number of bytes each machine word contains and number of machine words per memory location)

7 0
4 years ago
A computer that is running Windows Server 2016 has scheduled backups every night. However, reports show that some of the compute
iren2701 [21]

Answer:

Answer to the following question is The DCS Properties of Schedule tab i.e "schedule Performance Monitor".

Explanation:

During the collection of the data and the creation of the data set, you have to configure the following schedule, firstly we have to open the property for the set of the data collector.

After the collection of the data and the creation of the data set, by clicking the right data collector name you can successfully scheduled the options in the MMC(Microsoft Management Console) pane and then you select the properties.

3 0
4 years ago
Which of these codes is best for creating websites?
crimeas [40]

Answer:

B) HTML because HTML instructs the browser on how to display text and images in a web page. Recall the last time you created a document with a word processor. Whether you use Microsoft Word or Wordpad, Apple Pages, or another application, your word processor has a main window in which you type text, and a menu or toolbar with multiple options to structure and style that text.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which view In a presentation program displays you’re slides in full screen modes ?
    8·2 answers
  • PLEASE HELPP!! WILL MARK BRAINLIEST!!~~~~~
    11·1 answer
  • The advent of mobile systems run by Android and other operating systems opens a wide range of new system management and security
    5·1 answer
  • What happens it the offshore team members are not able to participate in the iteration demo due to time zone/infrastructure issu
    11·1 answer
  • Need help asap<br> give the correct answer!!
    15·2 answers
  • Write a program num2rome.cpp that converts a positive integer into the Roman number system. The Roman number system has digits I
    8·1 answer
  • Which programming languages is best for game development? ​
    10·1 answer
  • What was revolutionary about Web 2.0?
    5·1 answer
  • What is a distinguishing feature of 5G mm Wave?
    9·1 answer
  • Large and fast disks should be used for as doing so will ensure work is done as quickly as possible?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!