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

Answers

Answer 1

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;

                   }

               }

       }


Related Questions

what is memory address map​

Answers

the mapping between loaded executable or library files and memory regions, these are used for resolving memory addresses

Which is a potential disadvantage of emerging technologies? A. increased spread of misinformation due to advanced communication technologies B. inefficient usage of energy due to advanced manufacturing technologies C. only benefiting developed countries rather than developing ones D. slowing down global economic growth

Answers

Answer: I believe it’s D.

Explanation: Less developed countries may not be able to afford the new technology, while more developed ones will be able to do so. Meaning the less developed countries will most likely not change.

Which steps will import data from an Excel workbook? Use the drop-down menus to complete them.
1. Open the database.
2. Click the *BLANK*
tab.
3. In the import & Link group, click *BLANK*
4. Click *BLANK* to locate a file.
5. Navigate to and open the file to import.
6. Select the Import option.
7. Click OK.
8. Follow the instructions in the wizard to import the object.

Answers

Answer:

what are the blank options

Answer:

The answer is

1. External Data

2. Excel

3. Browse

Explanation:

EDGE 2021

What is the name for a piece of information from one record in one field ?

Answers

Answer:

Database field

Explanation:

A database sector corresponds to a specific piece of information from some kind of record. A database record consists of a collection of fields. Name, email, and contact information, for example, are fields in a telephone book record. 

Answer: C. Data Value

Explanation:

Intro to Access -Edg2022

By itself, the human eye cannot see anything in three dimensions. What does the passage say enables us to see the world in 3-D?

Answers

Answer:

he miracle of our depth perception comes from our brain's ability to put together two 2D images in such a way as to extrapolate depth. This is called stereoscopic vision.

Explanation:

Answer:

the way our brain and eyes work together

Explanation:

Roman numbers. Write a program that converts a positive integer into the Roman number system. The Roman number system has digits

I=1
V=5
X=10
L=50
C=100
D=500
M=1,000

Numbers are formed according to the following rules. (1) Only numbers up to 3,999 are represented. (2) As in the decimal system, the thousands, hundred, tens, and ones are expressed separately. (3) The numbers 1 to 9 are expressed as

I=1
II=2
III=3
IV=4
V=5
VI=6
VII=7
VIII=8
IX=9

As you can see, a I preceding a V or X is subtracted from the value, and you can never have more than three I's in a row. (4) Tens and hundreds are done the same way, except that the letters X, L, C and C, D, M are used instead of I, V, X, respectively.

Your program should take an input, such as 1978, and convert it to Roman numerals, MCMLXXVIII.

Answers

Answer:

The program in Python is as follows:

def Conversion(num):

   digitint = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4,1]

   digitroman = ["M", "CM", "D", "CD","C", "XC", "L", "XL","X", "IX", "V", "IV","I"]

   roman_num = ''

   i = 0

   while  num > 0:

       for _ in range(num // digitint[i]):

           roman_num += digitroman[i]

           num -= digitint[i]

       i+=1

   return roman_num

num = int(input("Enter number: "))

if num > 3999 or num < 0:

   print("Out of range")

else:

   print(Conversion(num))

Explanation:

See attachment for full program where I use comments to explain each line

The pointer to the dynamic array is called data, and the size of the dynamic array is stored in a private member variable called capacity. Write the following new member function: (C++ LANGUAGE)

void bag::triple_capacity( )
// Postcondition: The capacity of the bag's dynamic array has been
// tripled. The bag still contains the same items that it previously
// had.

Do not use the reserve function, do not use realloc, and do not cause a heap leak. Do make sure that both data and capacity have new values that correctly indicate the new larger array.

Answers

Answer:

Following are code to this question:

void bag::triple_capacity()//defining a method bag that uses the scope resolution operator to hold triple_capacity  

{

int* newArray = new int[3*capacity];//defining an array that holds capacity value

for(int x=0;x<capacity;x++)//defining for loop to hold array value

{

newArray[x] = data[x];//holding array value in newArray

}

delete[] data;//using the delete keyword to delete value in array  

data = newArray;//holding array value in data

capacity = capacity*3;//increaing the array size value

}

Explanation:

In this code, a method "bag" is declared that uses the scope resolution operator that holds the triple_capacity method, inside the method an array "newArray" is declared that uses the for loop to hold array value.

In the next step, the delete keyword is declared that delete data value and hold newArray value within it and at the last, it increases the capacity of the array.

Brainly not working for me not showing any ads or answers

Answers

Answer:

oof, try reloading the page?

Explanation:

Answer:

You should try logging in out your account

Rupesh wants to try programming with Eclipse. What is the first step he should take to make that happen?


download the Eclipse IDE

download the current Java Development Kit

create a restore point

disable his security program

Answers

Answer:

create a restore point

Explanation:

You are a visitor at a political convention with delegates; each delegate is a member of exactly one political party. It is impossible to tell which political party any delegate belongs to; in particular, you will be summarily ejected from the convention if you ask. However, you can determine whether any pair of delegates belong to the same party or not simply by introducing them to each other. Members of the same party always greet each other with smiles and friendly handshakes; members of different parties always greet each other with angry stares and insults.

Required:
Suppose more than half of the delegates belong to the same political party. Design a divide and conquer algorithm that identifies all member of this majority party and analyze the running time of your algorithm.

Answers

Answer:

The algorithm is as follows:

Step 1: Start

Step 2: Parties = [All delegates in the party]

Step 3: Lent = Count(Parties)

Step 4: Individual = 0

Step 5: Index = 1

Step 6: For I in Lent:

Step 6.1: If Parties[Individual] == Parties[I]:

Step 6.1.1: Index = Index + 1

Step 6.2: Else:

Step 6.2.1 If Index == 0:

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

Step 7: Else

Step 7.1: Index = Index - 1

Step 8: Print(Party[Individual])

Step 9: Stop

Explanation:

The algorithm begins here

Step 1: Start

This gets the political parties as a list

Step 2: Parties = [All delegates in the party]

This counts the number of delegates i.e. the length of the list

Step 3: Lent = Count(Parties)

This initializes the first individual you come in contact with, to delegate 0 [list index begins from 0]

Step 4: Individual = 0

The next person on the list is set to index 1

Step 5: Index = 1

This begins an iteration

Step 6: For I in Lent:

If Parties[Individual] greets, shakes or smile to Party[i]

Step 6.1: If Parties[Individual] == Parties[I]:

Then they belong to the same party. Increment count by 1

Step 6.1.1: Index = Index + 1

If otherwise

Step 6.2: Else:

This checks if the first person is still in check

Step 6.2.1 If Index == 0:

If yes, the iteration is shifted up

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

If the first person is not being checked

Step 7: Else

The index is reduced by 1

Step 7.1: Index = Index - 1

This prints the highest occurrence party

Step 8: Print(Party[Individual])

This ends the algorithm

Step 9: Stop

The algorithm, implemented in Python is added as an attachment

Because there is an iteration which performs repetitive operation, the algorithm running time is: O(n)

in a swap you need a variable so that one of the values is not lost ? Need help

Answers

Answer:

In a swap, the variable is cuttly.x

Explanation:

Answer:

temp

Explanation:

Write a function charInWord that takes in two parameters, a char (character) and a word (string). The program will return true if the character is in the word and false if it is not. If word is not a string type, or if char is not a string type, or if the length of char is greater than 1, the function should return None. Your main program should call the function and print char is in word if the function returns true, or char is not in word if the function returns false, using the user-supplied values instead of char and word. The program should print incorrect input provided if the function returns None. Ex: If the input is: a cat the output is: a is in cat Ex: If the input is: a club the output is: a is not in club Ex: If the input is: ab horse the output is:

Answers

Answer:

The program in Python, is as follows:

def charInWord(chr,word):

   if len(chr)>1:

       print("None")

   elif not(chr.isalpha() and word.isalpha()):

       print("None")

   else:

       if word.find(chr) == -1:

           print(chr+" is not in "+word)

       else:

           print(chr+" is in "+word)

chr = input("Character: ")

word = input("Word: ")

print(charInWord(chr,word))

Explanation:

This defines the function

def charInWord(chr,word):

This checks if the length of character is greater than 1

   if len(chr)>1:

If yes, it prints None

       print("None")

This checks if the character or the word contains invalid character

   elif not(chr.isalpha() and word.isalpha()):

If yes, it prints None

       print("None")

This is executed for valid parameters

   else:

If the character is not present, this is executed

       if word.find(chr) == -1:

           print(chr+" is not in "+word)

If the character is present, this is executed

       else:

           print(chr+" is in "+word)

The main begins here

This gets the character

chr = input("Character: ")

This gets the word

word = input("Word: ")

This calls the method and prints the required output

print(charInWord(chr,word))

Please help. 10 points
Question # 1
File Upload
Submit your newsletter that includes the following:

two or three columns
a title
at least three graphics, but not more than six

Answers

Answer:

God Is Good He Will Always Help You He Is Good And Always Good!!

If God Is For Us Who Can Be Against us?? Romans 8:31

Explanation:

Sorry im late. Hope I helped.

I will be doing the biography report.  

The Biography and Life of Henry Ford.

Column One: Who was Henry Ford?

Henry Ford was the founder of Ford Motor Company and also the mass producer of the automobile. Henry Ford was born in 1863. At the age of 16, he worked as a machinist apprentice. Later, Henry began to work the family farm while still working on creating steam engines. Henry had a big interest in steam engines, which would later contribute to him building his first working automobile.

Column Two: How did Henry Ford contribute to our society?

After marrying in 1888, Ford was hired to work for Edison Illuminating Company. His position was an engineer, and Ford began to accelerate his position in the company quickly. After a while, Ford created his first operating vehicle. This was called the "Quadricycle." Ford wanted to improve on his models, so he founded the Company Ford with others. Ford then began to develop methods of mass-producing automobiles to sell to the public. After success in business, he bought the whole company and owned it all by himself. Ford began to mass-produce automobiles. It is said that " The mass production techniques Henry Ford championed eventually allowed Ford Motor Company to turn out one Model T every 24 seconds." Ford passed away in 1945. He decided to give ownership to his son Edsel Ford before he died, but Edsel sadly died before Henry Ford. The Ford company's ownership was given to Ford's grandson, Henry Ford II.

Three Graphics:

An asset is any ___
that can be composited on top of a video.

Answers

Answer:

clip/edit and or photo

Explanation:

are the raw project assets (video or audio streams) that are created or ... is an NLE background process that occurs when certain types of edits are ... is the audio version of compositing—the act of combining multiple audio ... serves as a mask when superimposing one image over top of another.

GIVING BRAINLIEST ANSWER CORRECTLY! 20 POINTS


What is the purpose of a Post Mortem Review?

To check the code for spelling
To prove the algorithm is correct
To understand how the code can be improved
To check the code for formatting?

Answers

to understand how the code can be improved

Answer:

C . To understand how the code can be improved

The cutting tool that has a zig zag edge is called a?

Answers

The cutting tool that has a zig zag edge is called “Pinking shears “

what is the difference between multimedia and hypermedia​

Answers

Answer:

While multimedia simply refers to multiple forms of media, hypermedia is used in a much broader sense to refer to media with links to other media. Multimedia is anything you can see and hear, whereas hypermedia is something you can see and interact with at the same time.

What is the best way to improve an online search?
O use detailed keywords
O use a single keyword
O avoid keywords
O re-order the keywords

Answers

Answer: i think it’s A, i’m not sure. i’m still stuck on my own

Explanation:

Answer:

I would suggest:

A.

Explanation:

the more specific you are, the better results you would get.

Question 4
1 pts
Consider the following procedure called square that is meant to multiply a number by
itself and return the value.
PROCEDURE square number
Missing Instructions
RETURN squared
What should go in place of missing Instructions in order to make this procedure work as
intended?
number
number * number
O squared
number + 2
O squared - number number
O square - number number

Answers

Answer: squared ← number * number

Explanation:

Which item follows HTML instructions to assemble web pages?

o Client
o Search Engine
o Web Browser
o Web Server

Answers

The answer is web server

A gui allows you to interact with objects on the screen such as icons and buttons true or false

Answers

Answer:

True

Explanation:

can someone help me find all the solutions to the problem ​

Answers

Answer this with the dots connected. Why is it. You may ask? I bet it’s 40
It’s 40 hope this helps

PLEASE SOMEONE ANSWER THIS
If the old code to a passcode was 1147, and someone changed it, what would the new code be?

(I already tried 4117)



[I forgot my screen time passcode please someone help I literally can’t do anything on my phone.]

Answers

Answer:

Any of these?

Explanation:

1147. 4117. 7411

1471. 4171

1714. 4711

1741. 7114

1417. 7141

Answer:

1417

Explanation:

From the practice directory, you wish to capture a listing of files and directories to a file in your user2 directory, thus allowing you to keep track of what is in your user2 directory. What command would you use to redirect the output of a long listing of all files and directories under user2 directory and save the result to a new output file called homedir.list which is under the practice directory

Answers

Answer:

variable(s) determine the amount of potential energy an object has?

Explanation:

what is convergence ​

Answers

Answer:

the process or state of converging.

Explanation:

Answer:

the fact that two or more things, ideas, etc. become similar or come together.

a debate about city schools are more better than village schools​

Answers

No it is not because village school is the traditional education

The cat store needs your help! The base class Animal has private fields animalName, and animalAge. The derived class Cat extends the Animal class and includes a private field for catBreed. Complete main() to:
create a generic animal and print information using printInfo().
create a Cat animal, use printInfo() to print information, and add a statement to print the cat's breed using the getBreed() method.
Ex. If the input is:
Dobby
2
Kreacher
3
Maine Coon
the output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: Maine Coon
AnimalIformation.java
import java.util.Scanner;
public class AnimalInformation {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Animal myAnimal = new Animal();
Cat myCat = new Cat();
String animalName, catName, catBreed;
int animalAge, catAge;
animalName = scnr.nextLine();
animalAge = scnr.nextInt();
scnr.nextLine();
catName = scnr.next();
catAge = scnr.nextInt();
scnr.nextLine();
catBreed = scnr.nextLine();
// TODO: Create generic animal (using animalName, animalAge) and then call printInfo
// TODO: Create cat animal (using catName, catAge, catBreed) and then call printInfo
// TODO: Use getBreed(), to output the breed of the cat
}
}
Animal.java
public class Animal {
protected String animalName;
protected int animalAge;
public void setName(String userName) {
animalName = userName;
}
public String getName() {
return animalName;
}
public void setAge(int userAge) {
animalAge = userAge;
}
public int getAge() {
return animalAge;
}
public void printInfo() {
System.out.println("Animal Information: ");
System.out.println(" Name: " + animalName);
System.out.println(" Age: " + animalAge);
}
}
Cat.java
public class Cat extends Animal {
private String catBreed;
public void setBreed(String userBreed) {
catBreed = userBreed;
}
public String getBreed() {
return catBreed;
}
}

Answers

Answer:

Answered below

Explanation:

//TODO1

myAnimal.setName(animalName);

myAnimal.setAge(animalAge);

myAnimal.printInfo();

//TODO2

myCat.setName(catName);

myCat.setAge(catAge);

myCat.setBreed(catBreed);

myCat.printInfo();

//TODO

//Call the getter method of the cat class and //save the returned string in a variable to print //it out.

String breed = myCat.getBreed();

System.out.print(breed);

What is output if the user enters -5?
What is the output if the user enters 7? Edhesive 7.4 Lesson Practice

Answers

Answer:

for question 3 answer : 4               question4: its 28

Explanation:

x+7*2

The output if the user enters -5 is 4, while the output if the user enters 7 is 28. Both of these outputs will eventually depend on the program which is executed by a specific language.

What is the significance of the output of programming language?

Programming languages use classes and functions that control commands. The reason that programming is so important is that it directs a computer to complete these commands over and over again, so people do not have to do the task repeatedly. Instead, the software can do it automatically and accurately.

According to the context of this question, the actual number is the first output is found to be 1 and when -5 is added into it, it gives an output of 4. The same principle is applied in the second question as well but the actual number, in this case, would be different to it determines a different output.

Therefore, the output if the user enters -5 is 4, while the output if the user enters 7 is 28. Both of these outputs will eventually depend on the program which is executed by a specific language.

To learn more about Programming languages, refer to the link:

https://brainly.com/question/16936315

#SPJ2

asnwer the question 1 name the different kinds of slide views present in power point​ (plz give me answer of this q plzz

Answers

Answer:

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Explanation:

PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation.

Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

Slide transition is an inbuilt feature of a presentation software that automatically changes the slides at regular intervals.

Basically, the different kinds of slide views present in Microsoft PowerPoint application includes;

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Presenter view avails the user an ability to use two monitors to display his or her presentation. Thus, one of the monitors displays the notes-free presentation to your audience while the other monitor lets you view the presentation with notes that you have added to the slides, as well as the navigation and presentation tools.

An update log file contains the following information:

LogID Old.Name Old.Phone Old.City New.Name New.Phone New.City UpdateTimeStamp
15 Steve Gleason 212 834- 2345 Brooklyn Steven Gleason 212 834- 2345 NJ 01/21/22 07:02:09 UTC
16 Mabel Zurich 315 332 3833 Morristown Mabel Lee 315 332- 833 Camden 01/21/22 07:02:29 UTC
17 Juan Moroni 646 257- 7455 Bronx Juan Moroni 646 257- 7455 Long Island Jan. 21 2022 07:03:02 UTC

For LoglD 17 which of the following data structure issues are present?
a. Data parsing.
b. Cryptic data values.
c. Misfielded values.
d. Data consistency.
e. Data concatenation

Answers

Cooollll very goodnight
Other Questions
HELP ASAP PLS ANSWER THE QUESTION IN THE PIC I GIV BRAINLEST AND LOTS OF POINTS TO CORRECT ANSWER How has the effect of natural disasters on agriculture in South Carolina been different from the effects on agriculture in the rest of the country?A. Droughts were responsible for a tremendous loss in crop production andrevenue in South Carolina; in other parts of the country, droughts had littleeffect on crops.B. In the late 1800s, a series of deep freezes devastated cotton production in SouthCarolina; in other parts of the country, temperature drops did not result in croploss.C. Floods in the central part of the country caused widespread devastation and destruction; in South Carolina, flooding has not been a significant agricultural problem. D. Farms in South Carolina were more susceptible to destructive hurricanes; inother areas of the country, farms were generally more protected fromhurricanes. Dream of Butterfly Composition by Shoji Meguro and Lyrics written by Masao Komori Dream of Butterfly, or is life a dream?Don't wanna wake up 'cause I'm happier here Swaying and dissolving like bubbles in the dark oceanReaching for the shimmering shape in vain I can't believe in you but I cannot forget you I will dig up my faith and march on I cannot see ahead but I can't keep standing still So I will close my eyes and march on can't lay the blame on you but I can not forgive you So drenched up in rain I'll march on I cannot face the sun but I cannot dream at night So under the moonlight I'll march on Intercepts: independent practice Write the ordered pair describing the coordinates of each intercept. 1. X-intercept: -6 2. Y-intercept: -2.3 3. Y-intercept: 3/4 Charlie buys a new Bey Blade for $11.38. He gives the cashier $15.00. How much change will he get back? Select TWO ways he will get change. Write the expanded form of the expression. 4(8x - 2) I HAVE ALREADY CHOSEN THE T-REXFor this project, you will research an extinct organism and answer questions about your chosen organism. For BRAINLIEST you must answer all 5 questions with at least one full sentence IN YOUR OWN WORDS-What is the name of your chosen organism?-When and how did your organism go extinct?-Could anything have been done to prevent their extinction?-Where did your organism live, what was its natural habitat?-Describe the features of the organism, and include a photo From 1903 to 1957, there were three baseball teams from New York. All were successful and they often met in the World Series. The New York Yankees often represented the American League, while the Brooklyn Dodgers and New York Giants often represented the National League. Make a two-way table and use that table to predict who would win the next time they meet. Be sure to explain why you make your prediction. Please Please Please help on these 3 questions :) 20 POINTS!! - NO LINKS PLEASEWhat are the forces applied to a catapult while it's on the ground?What forces are applied to the catapult itself?What forces are applied to the marshmallow (object being launched)? Please answer them all to get Brainliest!! how many different words can be created by arranging the letters in SELFIESTICK? Name 10 of Melanie Martinez songs and I will give you brainliest! Pls help due soon Will ad brainilist importance of cycle events Which matches the inequality? How does coastal erosion shape Florida?PLS ANSWER ASAPCoastal erosion causes the sea level to rise.Coastal erosion causes the beach to wear away.Coastal erosion causes sand to move with longshore currents.Coastal erosion causes the formation of sinkholes in the ground. You can form a right triangle by cutting a what in half diagonally What kind of organisms are usually one celled? Many varieties of protozoan fossils have been found. True False Suppose x is any positive number.Circle 1: center (0, 0) and radius 2xCircle 2: center (0, 0) and radius 10xWhy iS circle 1 similar to circle 2? Both circles have congruent diameters. 1 Circle 1 and circle 2 have equal areas.O Circle 2 is a dilation of circle 1 with a scale factor of 0.2.O Circle 2 is a dilation of circle 1 with 1 a scale factor of 5. What was the main benefit of the factory system? (5 points) a It cut costs and made workers more efficient. b It gave people their first chance to support themselves. c It reduced pollution caused by family-based power sources. d It increased the value of the workers and as a result, salaries rose.