Java Engineering Programs Blog

finite state machine java code

finite state machine java code

import java.io.*; class FSM { public static void main (String args[])throws IOException { int fsm1,i,base=2,no=4,ans=0,ans1=0,m=0,m1=0,z=0; int b[]={0,0,1,1,2,2,3,3}; int c[]={0,1,0,1,0,1,0,1}; DataInputStream in=new DataInputStream(System.in); System.out.println(“Enter no of bits in Binary no”); fsm1=Integer.parseInt(in.readLine()); int a[]=new int[fsm1]; System.out.println(“Enter...

best fit program in java

best fit program in java

import java.io.*; class best { public static void main(String args[])throws IOException { int flag[]=new int[10]; int sm[]=new int[10]; int i,sr,nm; int sp,loc=0; int cntrl=1000; DataInputStream in=new DataInputStream(System.in); System.out.println(“Enter the no of memory segments\n”); nm=Integer.parseInt(in.readLine());...

Covert Channel program in java

Covert Channel program in java

Covert Channel is type of computer security attack that transfers information in a way that violates a security policy.Covert channel have been defined by Lampson in 1973 as a communication channel not designed for...

k-means Clustering program in java

k-means Clustering program in java

import java.io.*; import java.util.*; class cluster { public static void main (String args[])throws IOException { DataInputStream in= new DataInputStream(System.in); float m1,m2,q=0.0f,w=0.0f; int k_means; int z=0,i=0; int z1=0; float avg1,avg2; System.out.println(“Enter no of elements in...