Determining the usual method header

Assignment Help Biology
Reference no: EM131850752

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

Reference no: EM131850752

Questions Cloud

Where statement selects observations that begin : Where statement selects observations that begin with a T, followed by a single character, followed by an M, and followed by any number of characters.
How do the surreal images work in the poem : How do the surreal images work in the poem? Analyze what you think it means and how it might, even if it's surreal and unconventional, capture emotional state?
Username checker for a sites online registration : You have been asked to assist with a username checker for a sites online registration. Usernames are now allowed to have more than 5 symbols
Produce a program that accepts as input the mass : Produce a program that accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the volume of the object using the formula:
Determining the usual method header : This class contains a main method, declared with the usual method header: public static void main(String[] args) You can implement any other methods
Write an one page paper of your favorite stuffed toy : Write an one page paper of your favorite stuffed toy, brief explanation of it, describe how it is both personally meaningful or culturally significant to you.
What is the effective annual rate on loan : What is the effective annual rate on a loan that charges 8.2 percent, compounded quarterly?
Multiple level queue system : Using the same multiple level queue system from the previous exercise, if a job needs 175 ms to run to completion, how many times will the job be interrupted
Write an one page paper of your favorite riddle book : Write an one page paper of your favorite riddle book, a description of your memories and feeling connected to the book, why that means a great deal to you.

Reviews

Write a Review

Biology Questions & Answers

  Immune response to infectious disease

It is a very curcial concept to understand how the immune response is mounted against viruses, bacteria, protozoans and helminthes. For an effective immune response, both innate and adaptive immunity should work together.

  A review on advanced glycated end products (ages)

This Project report elaborates a critical review of important elements attached to Advanced Glycated End Products (AGEs). It is very crucial to understand the process called Millard reaction.

  Plastic as a soil stabilizer

Soil stabilization is the permanent physical and chemical alteration of soils to enhance their physical properties. Stabilization can increase the shear strength of a soil and control the shrink-swell properties.

  Principles of microbiology

This assignment has three parts which contains questions related to Microbiology. It contains basic principles of microscopy, staining techniques in microbiology and microbial growth in the food industry.

  List the biologic functions

Lipid metabolites are often seen as key elements in cellular signaling. Is this unique? Please provide several examples of the function of lipids as key elements in signal arrays and list the biologic functions these signals affect?

  Biologic function relationships

Please describe how one might search for chemical structure, biologic function relationships, involving small molecular weight lipophylic compounds. Provide one example.

  Case study on patient in the haematology laboratory

Write a case study which detailing a scenario of a patient being investigated in the Haematology laboratory.

  Use of pcr and genetic approaches in biotechnology

The use of PCR and genetic approaches in biotechnology

  Describe the role of this enzyme in honey

Glucose oxidase is an enzyme that can be used for measurements of glucose levels by combining this reaction with an oxygen probe.

  Genetic problems

What phenotypic ratio would you get if you crossed a white mouse and a heterozygous brown mouse?

  Prepare an essay on nosocomial infection

Prepare an essay on nosocomial infection.

  Monitoring and recording the blood pressure

To increase the awareness of monitoring and recording the blood pressure of patients and practice measuring blood pressure in a safe environment.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd