What is the error and how would you fix it in Code 2 on lines 41 and 42 on code 2 there are two…

What is the error and how would you fix it in Code 2 on lines 41 and 42 on code 2 there are two errors on ib.execute(); ib.fillTable(data); with the first one having an error of “Syntax error on token “execute”, Identifier expected after this token” and the second one having an error of “Multiple markers at this line – Syntax error, insert “)” to complete MethodDeclaration – Syntax error, insert “Identifier (” to complete MethodHeaderName – Syntax error, insert “SimpleName” to complete”. The goal of this code was to have the result in code 1 be displayed in table form ( which is what code 2

What is the error and how would you fix it in Code 2 on lines 41 and 42 on code 2 there are two errors on ib.execute(); ib.fillTable(data); with the first one having an error of “Syntax error on token “execute”, Identifier expected after this token” and the second one having an error of “Multiple markers at this line – Syntax error, insert “)” to complete MethodDeclaration – Syntax error, insert “Identifier (” to complete MethodHeaderName – Syntax error, insert “SimpleName” to complete”. The goal of this code was to have the result in code 1 be displayed in table form ( which is what code 2 does). Code 1: import java.text.DecimalFormat; import java.util.Scanner; public class Splits { private DecimalFormat df = new DecimalFormat(“00.00”); Scanner keyboard = new Scanner(System.in); booleandataOk=false; int numLaps = 0; String[] timesString; double[] timesDouble; double[] singleLaps ; String[] lapChange; public void execute() { System.out.println(“Enter the number or laps.”); numLaps=keyboard.nextInt(); keyboard.nextLine(); timesString = new String[numLaps]; timesDouble = new double[numLaps]; for(int i=0;i< { System.out.println("Enter time for lap "+(i+1)); timesString[i]=keyboard. nextLine(); timesDouble[i]=stringToSec(timesString[i]); } singleLaps= new double[numLaps]; singleLaps[0]= timesDouble[0]; for(int i=1;i< { singleLaps[i] = timesDouble[i]-timesDouble[i-1]; } lapChange = new String[numLaps]; lapChange[0]= "---"; for(int i=1;i< { if(singleLaps[i]=singleLaps[i-1]) { lapChange[i]="+"+df.format(singleLaps[i]-singleLaps[i-1]); } else { lapChange[i]="-"+df.format(singleLaps[i-1]-singleLaps[i]); } } System.out.println("LaptTotal TimetLap TimetDifference"); for(int i=0;i< { System.out.println("Lap "+(i+1) + "t" +timesString[i] + "tt" +secToString(singleLaps[i]) + "tt" +lapChange[i]); } System.out.println(timesString[1]); } public void fillTable(Object[][] data) { data = new Object[timesString.length][5]; int j=0; for(int i=0;i< { data[i][j] = i+1; data[i][j+1] = timesString[i]; data[i][j+2] = secToString(singleLaps[i]); data[i][j+3] = lapChange[i]; data[i][j+4] = new Boolean(false); } } public double stringToSec(String input) { input = input.trim(); int colon = input.indexOf(":"); String temp = input.substring(0, colon); int minutes = Integer.parseInt(temp); temp = input.substring(colon+1); double seconds = Double.parseDouble(temp); seconds = seconds + minutes*60; return seconds; } public String secToString(double input) { int minutes = (int)input/60; double seconds = input - (60*minutes); //DecimalFormat df = new DecimalFormat("00.00"); String s = minutes+":"+df.format(seconds); return s; } } Code 2: import java.text.DecimalFormat; import java.util.Scanner; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.AbstractTableModel; import java.awt.Dimension; import java.awt.GridLayout; /** * TableDemo is just like SimpleTableDemo, except that it * uses a custom TableModel. */ class TableDemo extends JPanel { private boolean DEBUG = false; public TableDemo() { super(new GridLayout(1,0)); JTable table = new JTable(new MyTableModel()); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); //Create the scroll pane and add the table to it. JScrollPanescrollPane = new JScrollPane(table); //Add the scroll pane to this panel. add(scrollPane); } public class MyTableModel extends AbstractTableModel { private String[] columnNames = {"Lap", "Total Time", "Lap Time", "Difference","true/false"}; Object[][] data; Splits ib = new Splits(); ib.execute(); ib.fillTable(data); public String[] getColumnNames() { return columnNames; } public void setColumnNames(String[] columnNames) { this.columnNames = columnNames; } public Object[][] getData() { return data; } public void setData(Object[][] data) { this.data = data; } public int getColumnCount() { return columnNames.length; } public int getRowCount() { return data.length; } public String getColumnName(int col) { return columnNames[col]; } public Object getValueAt(int row, int col) { return data[row][col]; } /* * JTable uses this method to determine the default renderer/ * editor for each cell. If we didn't implement this method, * then the last column would contain text ("true"/"false"), * rather than a check box. */ public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } /* * Don't need to implement this method unless your table's * editable. */ public booleanisCellEditable(int row, int col) { //Note that the data/cell address is constant, //no matter where the cell appears onscreen. if (col return false; } else { return true; } } /* * Don't need to implement this method unless your table's * data can change. */ public void setValueAt(Object value, int row, int col) { if (DEBUG) { System.out.println("Setting value at " + row + "," + col + " to " + value + " (an instance of " + value.getClass() + ")"); } data[row][col] = value; fireTableCellUpdated(row, col); if (DEBUG) { System.out.println("New value of data:"); printDebugData(); } } private void printDebugData() { int numRows = getRowCount(); int numCols = getColumnCount(); for (int i=0; i System.out.print(" row " + i + ":"); for (int j=0; j System.out.print(" " + data[i][j]); } System.out.println(); } System.out.println("--------------------------"); } } /** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { //Create and set up the window. JFrame frame = new JFrame("TableDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create and set up the content pane. TableDemonewContentPane = new TableDemo(); newContentPane.setOpaque(true); //content panes must be opaque frame.setContentPane(newContentPane); //Display the window. frame.pack(); frame.setVisible(true); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }

Elite Writer Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.