Question: (Using Java) This assignment combines p4.12 and p4.14. Write a program that (1) first ask a user to input a positive integer, (2) use a

(Using Java)

This assignment combines p4.12 and p4.14. Write a program that

(1) first ask a user to input a positive integer,

(2) use a "do while" loop to

print out the binary representation of the integer

to do that, you first print the remainder number %2, then replace the number with number /2. Keep going until the number is 0. For example, if the user provides the input 13, the output should be:

1 0 1 1

(3) ask the user to input a word

(4) use a "nested for" loop to

print all substrings of the word

for example, if the input is "rum", its substrings are

r

u

m

ru

um

rum

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!