Question: Java programming The code should be well documented.(JavaDoc) 1. a. Write a class named TestScores. The class constructor should accept an array of test scores
1. a. Write a class named TestScores. The class constructor should accept an array of test scores as its argument. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 100, the class should throw an IllegalArgumentException. Demonstrate the class in a program b. Redo question a. by using an exception that you create named InvalidScore Exception 2. Write a program that reads a file and writes a copy of the file to another file with line numbers inserted. 3. In Internet programming, programmers receive parameters via a query string, which looks like a String with fields separated by the "&" character. Each field typically has a metadata part that identifies the data followed by an equals sign and then the data. An example of a query string is: first-Mike&last=Jones&id=mikel&password=hello Using Scanner , parse a query string and output each field on a different line after replacing the equal sign with a colon followed by a space. For example, for the preceding sample query string, the output should be: first: Mike last: Jones id: mikel password: hello 4. Write a program that reads a file and counts how many lines it contains. 5. Write a program that reads a text file that contains a grade (for instance, 87) on each line. Calculate and print the average of the grades. 6. Write a program that reads from a file data then save it to another file but has to add the two characters ** after each data (word or number). See the example below Input text: Hello world 67 Saved text: Hello** word** 67**
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
