Ask Biology Expert

Need help writing this class:

Note: Only basic java knowledge, just started the course

This class contains a main method, declared with the usual method header: public static void main(String[] args) You can implement any other methods that you want to in this class, but they must be declared as private methods. The input to the program will consist of two files: a file to compress and a file containing the compression codes. The output will be the compressed file. In this class you must implement the algorithm described in Section 3. To execute your program from the command line you must type java Compress fileName compressionCodesName 5 where fileName is the name of the file to compress and compressionCodesName is the name of the file storing the compression codes. The compressed file must be stored in a file with the same name as the original one, but with extension ".zzz". For example if the name of the input file is test.txt then the name of the compressed file must be test.zzz. If you are using Eclipse, you need to specify the names of the two input files in the list of program arguments of Eclipse. Note that you need to store the input files in the same folder where Eclipse has the src folder, otherwise Eclipse will not be able to find them. Note that within method main you can access the names of the two input files through the parameter args: args[0] stores the name of the first file and args[1] stores the name of the second file. For example, if the program is executed like this: java Compress text7.txt codes.txt Then we can, for example, print the names of the files from within method main as: public static void main(String[] args) { System.out.println("Name of file to compress: "+args[0]); System.out.println("Name of file storing compression codes: "+args[1]); To get the name of the output file you can use, for example, the following code: String outputName = args[0].substring(0, args[0].length() - 3) + "zzz"; Method substring will return the name of the input file (args[0]) minus its last 3 characters (that should contain the extension "txt).

Biology, Academics

  • Category:- Biology
  • Reference No.:- M92679110
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Biology

Case study question -case study - mary 21 years old

Case Study Question - Case Study - Mary, 21 years old, presented to the hospital emergency department with an infected laceration on her left foot. Mary was at a beach resort four days ago, when she trod on a broken glas ...

Assignment -the upper-case blue letters are the 14th exon

Assignment - The upper-case, blue letters are the 14th exon (of 20) in the Hephl1 gene in mice. The lower-case (black) letters are from the flanking introns.  The highlighted bases indicate primers that may be used to ge ...

Question - a pure strain of mendels peas dominant for all

Question - A pure strain of mendel's peas, dominant for all seven of his independently assorting genes, was testcrossed. How many different kinds of gametes could the F1 PRODUCE?

Igfbp2 rbp4 and factor d post bariatric surgeryigfbp2 what

IGFBP2/ RBP4 and Factor D Post Bariatric Surgery IGFBP2 ( what the normal physiological action in the body? And how it affectedby obesity? andpost bariatric surgery?) RBP4 (what the normal physiological action in the bod ...

Assignment on nutrition - q1 task you need to select 2

Assignment on Nutrition - Q1. Task: You need to select 2 different age groups of your choice. You will need to plan balanced meals with snacks for a day. Once you have laid out the meal plan you need to: Explain why the ...

Question - gene cloning a please write the steps to clone

Question - Gene Cloning a) Please write the steps to clone the protease gene from Bacillus strain whose genome sequence is not known. b) Express the protease gene to obtain the enzyme in high yield, please plan your prot ...

Instructions address each question below as it relates to

Instructions: Address each question below as it relates to the caw study given. A patient was brought to the Emergency Department by ambulance with two arrow wounds. One arrow is still in the patient on the left side; en ...

Use of molecular tools and bioinforrnatics in the diagnosis

Use of Molecular Tools and Bioinforrnatics in the Diagnosis Characterization of Enteric Pathogens from a Case Study Purpose: The purpose of this project is to familiarize the student with modern molecular tools and bioin ...

Experiment 1 staining video1 open the media player by

Experiment 1: Staining Video 1. Open the Media Player by clicking on the film-strip button in the lower left of the lab's window frame, as shown below. The Media Player is a repository of images, videos, saved snapshots, ...

Chosen dr jan nolta- stem cell researcher head of uc davis

Chosen Dr. Jan Nolta- Stem Cell Researcher Head of UC Davis Stem Cell Program Director Topic Background: early Stem cells have the ability to develop into many different types of cells. Stem Cell Research is not without ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As