Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in java Q2. Programming problem 1. [1 mark] Define a class for Binary with one private String variables: binaryStr (String). 2. [1 markImplement a constructor
in java
Q2. Programming problem 1. [1 mark] Define a class for "Binary with one private String variables: binaryStr (String). 2. [1 markImplement a constructor with no parameters that sets binary Str to "0". 3. [1 mark] Implement constructor with one parameter that should be used to set binary Str variable. 4. Assume that set and get methods are implemented for binaryStr. 5. [4 marks) Implement a method convert, which computes and returns the integer number that was represented by binary Str. Note that decimal dex2d2d2+_ Example: find the decimal value of "11001": binary number 1 power of 2:24 22 22 21 20 "11001'-1 .20 +0.21 +0.22 +1.25 +1.24 - 25 6. [1 marks) Implement the toString method, which should return a String that include the value of binaryStr and its decimal representation [2 marks] Finally, test the Binary class using a tester class as follows. 1. Create a Binary object bl with the value of "1100". b. Print out the object b1 decimal representationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started