Question: import java.io . IOException; import java.util.List; public class MasterControl { static ScannerWrapper scannerWrapper = ScannerWrapper.getInstance ( ) ; static SystemWrapper systemWrapper = SystemWrapper.getInstance ( )
import java.ioIOException;
import java.util.List;
public class MasterControl
static ScannerWrapper scannerWrapper ScannerWrapper.getInstance;
static SystemWrapper systemWrapper SystemWrapper.getInstance;
List read null;
public static void mainString args
MasterControl masterControl new MasterControl;
try
masterControl.startscannerWrapper systemWrapper;
catch IOException e
throw new RuntimeExceptione;
public void startScannerWrapper scannerWrapper, SystemWrapper systemWrapper
Input input;
Output output;
try
System.out.printlnEnter to read from console or to read from file:";
int choice Integer.parseIntSystemconsolereadLine;
if choice
input new InputFromConsole;
else if choice
input new InputFromFile;
else
throw new IllegalArgumentExceptionInvalid choice";
CircularShifter circularShifter new CircularShifter;
Alphabetizer alphabetizer new Alphabetizer;
System.out.printlnEnter to write to console or to write to file:";
choice Integer.parseIntSystemconsolereadLine;
if choice
output new OutputToConsoleMasterControlsystemWrapper;
else if choice
output new OutputToFile;
else
throw new IllegalArgumentExceptionInvalid choice";
read input.read;
List shift circularShifter.shiftLinesread;
List sort alphabetizer.sortshift;
output.writesort;
catch IOException e
eprintStackTrace;
C:UsersslashIdeaProjectsWeek srcmainjavaMasterControljava::
java: exception java.ioIOException is never thrown in body of corresponding try statement
C:UsersslashIdeaProjectsWeek srcmainjavaMasterControljava::
java: exception java.ioIOException is never thrown in body of corresponding try statement
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
