Question: Using Java, please complete the following: 6. (15 pts.) Write a program that reads its standard input (fully, until end of input) and writes exactly

Using Java, please complete the following:

Using Java, please complete the following: 6. (15 pts.) Write a program

6. (15 pts.) Write a program that reads its standard input (fully, until end of input) and writes exactly two lines (terminated by the newline character) to its standard output. The first line is "Hello, z" with a replaced by the contents of the first line of the standard input. The second line of the output is Goodbye, y"), with y replaced by the contents of the last line of the input. In case the input has less than one line, the string "stranger should replace both x and y. This program should write any reasonable tracing/debugging information to standard error. (Writing nothing to standard error is a valid choice.) 6. (15 pts.) Write a program that reads its standard input (fully, until end of input) and writes exactly two lines (terminated by the newline character) to its standard output. The first line is "Hello, z" with a replaced by the contents of the first line of the standard input. The second line of the output is Goodbye, y"), with y replaced by the contents of the last line of the input. In case the input has less than one line, the string "stranger should replace both x and y. This program should write any reasonable tracing/debugging information to standard error. (Writing nothing to standard error is a valid choice.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!