programing

Turn in a printout of your program Homework6.java. Your .java and .class files should be in your cosc1123 directory.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

1. Write a program that prompts the user to enter the name of an input file, and then writes every other line (starting with the first line) from the input file to the file everyOther.txt. Print the length of each line to the screen. Suppose the text file data.txt contains:

Hello, hi

The quick brown

fox jumps over

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

the pond

Sample Run:

Please enter the input file: data.txt

The length of the lines: 9  15  14  8

When you open the file everyOther.txt, it contains:

Hello, hi
fox jumps over

2. Write a program that stores integer exam scores in an array. Ask the user to enter the number of exam scores, and then prompt the user to enter each exam score. Then offer the user a choice of the options: average, min, max, and produce the requested value for the given exam scores.

Sample Run:

How many exam scores? 4

Exam 1: 90

Exam 2: 100

Exam 3: 80

Exam 4: 90

Calculate 1) average, 2) min, 3) max: 2

Min: 80

Still stressed with your coursework?
Get quality coursework help from an expert!