Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Trace the flow of carbon within the process of

Trace the flow of carbon within the process of photosynthesis. Be sure to include the following terms in your description: Glucose.NADPH,ATP, Calvin cycle, RUBISCO,CO2.

Question 1go outside during daylight hours to a natural or

Question 1. Go outside during daylight hours to a natural or semi-natural space (e.g., Burton's Pond, an urban park, your backyard). Sit still for 20 minutes and closely observe the plants and animals around you. Describ ...

Question write a 525- to 700-word paper on the genetic

Question: Write a 525- to 700-word paper on the genetic disorder (Sickle Cell Disease ). Include the following in your paper: Summarize the Chromosomal Theory of Inheritance and how chromosomal abnormalities can lead to ...

Is the iso-osmotic point different for different solutes

Is the iso-osmotic point different for different solutes? Please specify in what ways can the iso-osmotic points be different and why there is a difference.

Bioinformatics assignment -in this assignment should check

Bioinformatics Assignment - In this assignment should check the following sequence and test whether it has the following restriction cut sites. This searching should be done globally, that is, it should check for all pos ...

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 ...

What is the complementary strand for 5-atgcatgcatgccc-3how

What is the complementary strand for: 5'-ATGCATGCATGCCC-3' How many turn(s) will this strand have? Are Eukaryotic cells always diploid during S phase whereas bacteria are only haploid at the end of DNA replication?

Question please provide an answer to the question in 150

Question: Please provide an answer to the question in 150 words Pretend that you have just met someone who has never heard of "natural selection."Explain to him/her how natural selection works. Use one particular type of ...

Diffusion and osmosis questionin your large intestine the

Diffusion and osmosis question In your large intestine, the water from the food you have eaten needs to be kept in the body to prevent dehydration. Therefore the high concentration of water in feces needs to be moved int ...

Write the null hypothesis for the effect of temperature on

Write the null hypothesis for the effect of temperature on catechol oxidase activity?

  • 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