Java Playing with The Bits & Hide the Number Programming Project
Part 1 Playing with the bits.
Get the source from A3.java
Get a sample image sample.png
- What you need to do: Look for the instructions in the source code.
- Here is how the output image should look like: out.png (attached in the zip file)
- Part 2 (. Hide the number.
Write a program that asks the user for a number (an integer). Then your program loads a png image and hides the number in the image using the LSB method.
Write another program that loads an image in which a number has been hidden. Then retrieve and display the hidden number.
The following program iterates through each bit of a number, from the most significant bit to least significant bit.
import java.util.Scanner;
public class A {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print(“Please give me a number: “);
int N = in.nextInt();
System.out.println(“nAn integer is ” + Integer.SIZE + ” bits long.n”);
for(int i=Integer.SIZE-1; i >= 0; i– ) {
int b = (N >> i) & 0x01;
System.out.print(b + ” “);
}
System.out.println();
}
}
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.