write java programs

Write java programs

The detail will be in the following files

Please include algorithm by comments