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

  How much acid phophatase is present in 1g of wheat germ

In Biochemistry lab, we isolated the enzyme acid phosphatase from wheat germ, then tested for its velocity. One of the study questions asked "How much acid phophatase is present in 1g of wheat germ?" I am not sure how to go about answering this qu..

  How human body works with at least one other body system

Detail the importance of your chosen body system, the homeostasis of the system, and how it works with at least one other body system.

  How are microorganisms destroyed by moist heat

How are microorganisms destroyed by moist heat? By dry heat? Are some microorganisms more resistant to heat than others? Why

  Discuss treatment options including medicines treatment

Discuss treatment option, including medicines/alternative treatment. Discuss causes/risk factors. Include  incidence rate or statistics. Explain the resources you would use if you or someone you knew had this type of cancer.

  The Km of an enzyme and Vmax

The Km of an enzyme: Vmax:

  Difference between fertility control and birth control

1. Explain the difference between fertility control and birth control. 2. What are four different types of barrier methods available?

  What is epigenetics

What is epigenetics and how does it effect gene expression? What role does epigenetics play in cancer?

  Types of studies that are used in this practice

Q1. Describe the term occupational epidemiology and explain the types of studies that are used in this practice.

  Sort the parts of a nucleic acid

Sort the parts of a nucleic acid according to whether each occurs exclusively in DNA, exclusively in RNA, or in both types of nucleic acid.

  Describe the process of fertilization

Describe the process of fertilization. Compare and contrast oogenesis and spermatogenesis. Describe how estrogen and testosterone affect the body

  What is dominant/recessive inheritance

What is dominant/recessive inheritance? What is X-linked inheritance? What is codominant inheritance of genes? What is a Punnett Square?

  What is the biological name of the furrow or groove

What is the biological name of the furrow or groove on the surface of the brain

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