Question: I need help with this lab 8. Write a program that takes in an integer (typed in by the user) and returns its binary equivalent.

I need help with this lab
8. Write a program that takes in an integer (typed in by the user) and returns its binary equivalent. For example: Enter a positive integer...28 28 -> 11100 Enter a positive integer...137 137 ==> 10001001 Enter a positive integer...649 649 ==> 1010001001 You must use the driver program shown below. Note that the getBinary method of the Binary class returns an array of ints. public class TestBinary public static void main(String args[]) System.out.print("Enter a positive integer..."); int n = Savitchin.readInt : Binary b = new Binary(n): int[] a = b.getBinaryO; System.out.print( n + " ==>" ); for( int k = 0; k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
