Programming Exercise Write a program which asks the user to specify the name of an input/output file (using an fstream object) and an output-only file (using an ofstream object). The program should read the fstream file, and store the contents of the file in an array of structures. (Each line of input text should be placed in one element of the array.) After reading the complete file into this array, output the contents of the array of structures to the output-only file with each line formatted as described below. }; After reading the complete fstream file into the array of structs, the program should write the contents of the array to the output-only (ofstream) file. Each line of text in the output file must contain the field values from one FileText structure, in the format specified below: lineNumber <fileOffset,length >:contents Notice that each line of the original text is preceded by: The line number. The file offset (bytes from the beginning of the file). Length of the original text for that particular line. Sample Input File: The Gettysburg Address Sample Output File lineNumber <fileOffset,length >:contents Solution { case 1: page.setColor(Color.BLACK); break; case 2: page.setColor(Color.BLUE); break; case 3: page.setColor(Color.CYAN); break; case 4: page.setColor(Color.DARK_GRAY); break; case 5: page.setColor(Color.GRAY); break; case 6: page.setColor(Color.GREEN); break; case 7: page.setColor(Color.LIGHT_GRAY); break; case 8: page.setColor(Color.DARK_GRAY); break; case 9: page.setColor(Color.MAGENTA); break; case 10: page.setColor(Color.ORANGE); break; case 11: page.setColor(Color.PINK); break; case 12: page.setColor(Color.YELLOW); break; } } public void actionPerformed(ActionEvent e) { //*** buttons are active String actionCommand = e.getActionCommand(); //*** one of two possible values of actionCommand if (actionCommand.equalsIgnoreCase(\"Draw Graph\")) { System.out.println(\"Draw Lines has been called\"); paint = true; countTotal = 0; count = 0; repaint();//*** method paint() is called again } else if (actionCommand.equalsIgnoreCase(\"Clear Graph\")) { System.out.println(\"Clear Lines has been called\"); this.clear(); inputLineNumber1.setText(\"\"); inputLineNumber2.setText(\"\"); } } public void clear() { //*** Graphics object is gotten Graphics g = getGraphics(); Color c = getBackground(); g.setColor(c); //*** lines of the background color cover up the image for(int i=100;i<1250;i++) g.drawLine (i,500, i,150); for(int i=600;i<1000;i++) g.drawLine (i,700, i,75); } } .