Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Question I only put all line into the set, but have trouble with the output part. 1. [5 marks] Read the input one line

Java Question

I only put all line into the set, but have trouble with the output part.

image text in transcribedimage text in transcribed

1. [5 marks] Read the input one line at a time until you have read all n lines and imagine these lines are numbered ., Next output lines floor(n/2 . -1 followed by lines 0, floor(n 2)-1 Your code goes here - see Parte for an example @param r the reader to read from @param w the writer to write to @throws IOException o: public static void doIt(BufferedReader r, Printwriter w) throws IOException 7 Your code goes here -see Parte for an example Set mySet-new HashSet (); for(String line -r.readLine() line nul1; line -r.readLine)) mySet.add(line)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

More Books

Students also viewed these Databases questions

Question

How is the number of factors decided in most EFA programs?

Answered: 1 week ago

Question

3. What should a contract of employment contain?

Answered: 1 week ago

Question

1. What does the term employment relationship mean?

Answered: 1 week ago