Reference no: EM13312802
1. For all assignments, always use comments to explain your program.
2. You must use the names given to name your program.
Objectives:
1. To gain experience with string objects.
2. To gain experience with generic algorithms.
3. To gain experience with files - opening for input and output.
Documentation:
1. Explain the purpose of the program as detail as possible
2. Develop a solution for the problem and mention algorithms to be used
3. List data structures to be used in solution.
4. Give a description of how to use the program and expected input/output
5. Explain the purpose of each class you develop in the program.
Programming:
1. For each method, give the pre and post conditions and invariant, if any
2. Program execution according to the requirements given
3. Naming of program as required
4. Print out of source code
Description of program:
You are to write a program name wordcount.java that prompt the user for a user input file name, reads the input words and do the following with those words:
1. Count the amount of words in the file. A word can end with a --- space, EOLN character or a punctuation mark (which will be part of the word).
2. Count the amount of lines in the file.
3. Count the amount of alphanumeric characters in the file.
4. Count the number of sentences in the file.
5. Count the amount of vowels in the file - only a, e, i, o, u are vowels.(This includes upper case also...A, E, I, O, U)
6. Count the amount of punctuations in the file.
You must output the above information both on the screen as well as an output file name "output.txt".
Here are some requirements for the program:
The program must work even if the input file is empty. If this is the case print a message saying that "the input file is empty" and then terminate the program.
Implementation:
Use as many generic algorithms as possible so that the size of the program can be reduced.
How to find out the [h3o+] and [oh-]
: Determine the [H3O+], [OH-], pH, and pOH for each of the following solutions. A solution of 1.65 x 10-4 M HCl
|
What is the outward force on the window
: A viewing window in the Atlanta aquarium is 58 inches wide and 52 inches high. what is the outward force on the window
|
By how many percents did the wavelength of the peak change
: The temperature of a black body is increased by 10.5 percents. By how many percents did the wavelength of the peak change
|
Find the size of the contact force between the two blocks
: Two blocks are stacked on a frictionless table. A horizontal force F is applied to M2. If M1=1.39kg, M2=3.02 Kg, and F=6.3 N, find the size of the contact force between the two blocks
|
Explain the purpose of the program as detail as possible
: Count the amount of words in the file. A word can end with a --- space, EOLN character or a punctuation mark (which will be part of the word).
|
Find the direction of the electric field
: In a certain region of space, the electric potential is given by V= 6y. The potential V is given in volts, the coodinate y is given in meters. Find the direction of the electric field
|
What is the magnitude of the intial velocity
: A tennis ball is thrown from ground level with velocity v_0 directed 30 degrees above the horizontal. what is the magnitude of the intial velocity
|
What is its kinetic energy at the later time
: A proton accelerates from rest in a uniform electric field of 524 N/C. At some later time, its speed is 2.36 × 106 m/s. What is its kinetic energy at the later time
|
Can you recall a situation in which you had to deal
: Can you recall a situation in which you had to deal with a conflict in values? What was it? How did you resolve this issue?
|