Question: Implement a java program to check whether the given number is odious or not. Follow the steps for implementing program. V Create an interface
Implement a java program to check whether the given number is odious or not. Follow the steps for implementing program. V Create an interface named binary and get the user input. v Create a class conversion that implements binary to perform binary conversion for given number. v Create a class Count that implements binary and count the number of one's available. v Create a class Test that implements binary and check the result as either odd or even. V Write an application named DemoOdious and creates object of each of these classes and demonstrates the display () method for each class. Save the files as binary.java, conversion.java, count.java, test.java, and DemoOdious.java. Note: An odious number is a non-negative number that has an odd number of l's in its binary representation. Example: The binary representation of 3 is 011, and 0+1+1 = 2, and 2 is not an odd number. Output A: Leaf Class: - Output C: Leaf Class: - Changing colors.. Page Class: - Going to the next page.. Pancake Class: - Changing colors.. Page Class: - Going to the next page.. Pancake Class: - Flipping. Coin Class: - Flipping.. Output B: Leaf Class: - Flipping the coin... TV Class: - Changing colors.. Page Class: - Going to the next page.. Pancake Class: - Flipping.. Coin Class: - Switch on the TV.. Output 2: Enter the number: 7 7 is an odious number. Flipping the coin.. TV Class: - Enter the number: 9 Switch on the TV... 9 is not an odious number.
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
CODE import javautil public class Odious public static ... View full answer
Get step-by-step solutions from verified subject matter experts
