• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

Calculator

I am trying to modify my code to remove the table but still do the calculations. I have done it but it compiles with errors can you tell me what I am doing wrong.
WK4MortgageCalculatorGUI.java
0
IchigoMD
Asked:
IchigoMD
  • 14
  • 8
  • 7
3 Solutions
 
for_yanCommented:
YOu need one more brace before method calcaulateMortgagePayment
0
 
objectsCommented:
you missed a closing brace }

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class WK4MortgageCalculatorGUI extends JFrame /*
													 * implements
													 * TableModelListener
													 */{

	public static void main(String[] args) { // Calling Main Method

		WK4MortgageCalculatorGUI frame = new WK4MortgageCalculatorGUI(); // Frame
																			// creation
																			// for
																			// GUI

		// set title and default close operation
		frame.setTitle("McBride Financial Services' Mortgage Calculator");
		frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
		frame.setVisible(true);
	}

	// Setting Array Variables
	private double[] loanTerm = { 7, 15, 30 }; // Loan Term Years for Array
	private double[] interestRates = { 5.35, 5.5, 5.75 }; // Interest Rates for
															// Array
	// Panels Container Setup
	// Top container
	private JPanel topPanel;
	// Name Panel
	private JPanel namePanel;
	private JLabel nameLabel;
	// Loan Amount Pane
	private JPanel loanAmountPanel;
	private JLabel loanAmountLabel;
	private JTextField loanAmountField;
	private ButtonGroup buttonGroup;
	private JRadioButton fixedOptRadioButton;
	private JRadioButton customOptRadioButton;
	// Loan Term and Interest Rate Panel
	private JPanel loanTermInterestRatePanel;
	private JLabel loanTermLabel;
	private JTextField loanTermField;
	private JLabel interestRateLabel;
	private JTextField interestRateField;
	// Panel for Interest Rate and loan Term
	private JPanel comboPanel;
	private JLabel interestRateAndLoanTermLabel;
	private JComboBox interestRateAndLoanTermComboBox;
	// Calculate and Reset Button Panel
	private JPanel buttonsPanel;
	private JButton ResetButton;
	private JButton CalculateButton;
	private JLabel monthlyPaymentLabel;
	private JLabel paymentLabel;

	// Table Components
	// private JPanel amortizationPanel;
	// private JTable amortizationTable;
	// private DefaultTableModel model;
	// private JScrollPane scrollPane;
	public WK4MortgageCalculatorGUI() {
		initComponents();
	}

	private void initComponents() {
		namePanel = new JPanel(new GridLayout(1, 2));
		nameLabel = new JLabel("Welcome to McBride's Mortgage Calculator");
		loanAmountPanel = new JPanel(new GridLayout(2, 2));
		loanAmountLabel = new JLabel("Loan Amount:");
		loanAmountField = new JTextField(10);
		loanAmountField.setBackground(Color.lightGray);
		buttonGroup = new ButtonGroup();
		customOptRadioButton = new JRadioButton("Custom Option");
		// Allows User to chose which option to use
		customOptRadioButton.addActionListener(new ActionListener() {
			@Override
			// Enables the fields for use
			public void actionPerformed(ActionEvent arg0) {
				interestRateAndLoanTermLabel.setEnabled(false);
				interestRateAndLoanTermComboBox.setEnabled(false);
				loanTermLabel.setEnabled(true);
				loanTermField.setEnabled(true);
				interestRateLabel.setEnabled(true);
				interestRateField.setEnabled(true);
			}
		});
		// customOpt is selected as default Week 4 option
		// customOptRadioButton.setSelected(false);// Week 4 option
		fixedOptRadioButton = new JRadioButton("Fixed Option");
		fixedOptRadioButton.setSelected(true);
		fixedOptRadioButton.addActionListener(new ActionListener() {
			@Override
			// Enables the fields for use
			public void actionPerformed(ActionEvent arg0) {
				loanTermLabel.setEnabled(false);
				loanTermField.setEnabled(false);
				interestRateLabel.setEnabled(false);
				interestRateField.setEnabled(false);
				interestRateAndLoanTermLabel.setEnabled(true);
				interestRateAndLoanTermComboBox.setEnabled(true);
			}
		});
		// Buttons that allow user to chose
		namePanel.add(nameLabel);
		buttonGroup.add(customOptRadioButton);
		buttonGroup.add(fixedOptRadioButton);
		loanAmountPanel.add(loanAmountLabel);
		loanAmountPanel.add(loanAmountField);
		loanAmountPanel.add(customOptRadioButton);
		loanAmountPanel.add(fixedOptRadioButton);

		// Creates the Panel for Loan term and Interest Rates
		loanTermInterestRatePanel = new JPanel(new FlowLayout());
		loanTermLabel = new JLabel("Loan Term:");
		loanTermField = new JTextField(10);
		loanTermField.setBackground(Color.lightGray);
		interestRateLabel = new JLabel("Interest Rate: ");
		interestRateField = new JTextField(10);
		interestRateField.setBackground(Color.lightGray);
		// interestRateField.setBorder((Border) Color.black);
		loanTermInterestRatePanel.add(loanTermLabel);
		loanTermInterestRatePanel.add(loanTermField);
		loanTermInterestRatePanel.add(interestRateLabel);
		loanTermInterestRatePanel.add(interestRateField);
		// Creates the Panel for Fixed Rate Option
		comboPanel = new JPanel(new GridLayout());
		interestRateAndLoanTermLabel = new JLabel(
				"Fixed Loan Term & Interest Rates:  ");
		Object[] items = { "7 Years at 5.35%", "15 Years at 5.50%",
				"30 Years at 5.75%" };
		interestRateAndLoanTermComboBox = new JComboBox(items);
		interestRateAndLoanTermComboBox.setBackground(Color.cyan);
		comboPanel.add(interestRateAndLoanTermLabel);
		comboPanel.add(interestRateAndLoanTermComboBox);
		// Creates the Fixed Rate Option as the default option on start up
		interestRateAndLoanTermComboBox.setEnabled(true);
		// Reset and Calculate Button Panel placing Buttons next to each other
		buttonsPanel = new JPanel(new GridLayout(2, 2));
		ResetButton = new JButton("Reset");
		ResetButton.setBackground(Color.yellow);
		ResetButton.addActionListener(new ActionListener() { // Clears the field
																// so the user
																// can start all
																// over

					@Override
					public void actionPerformed(ActionEvent arg0) {
						loanAmountField.setText("");
						loanTermField.setText("");
						interestRateField.setText("");
						paymentLabel.setText("");
						// DefaultTableModel dm =
						// (DefaultTableModel)amortizationTable.getModel();
						// dm.getDataVector().removeAllElements();
					}
				});
		CalculateButton = new JButton("Calculate");
		CalculateButton.setBackground(Color.green);
		CalculateButton.addActionListener(new ActionListener() { // Calculates
																	// the to
																	// give user
																	// a monthly
																	// payout
																	// and a
																	// tabel to
																	// show
																	// payments
																	// over the
																	// term

					@Override
					public void actionPerformed(ActionEvent e) {

						doIt();

					}

				});

		monthlyPaymentLabel = new JLabel("Monthly Payment:");
		paymentLabel = new JLabel("");
		paymentLabel.setHorizontalAlignment(SwingConstants.TRAILING);

		buttonsPanel.add(CalculateButton);
		buttonsPanel.add(ResetButton);
		buttonsPanel.add(monthlyPaymentLabel);
		buttonsPanel.add(paymentLabel);

		/*
		 * //Creates the table for the transaction results and adds it to the
		 * pane amortizationTable = new JTable(); model = new
		 * DefaultTableModel(); model.addTableModelListener(this);
		 * model.fireTableChanged(new TableModelEvent(model));
		 * amortizationTable.setModel(model);
		 * amortizationTable.setAutoscrolls(true); scrollPane = new
		 * JScrollPane(); scrollPane.getViewport().add(amortizationTable);
		 * scrollPane.setViewportView(amortizationTable); amortizationPanel =
		 * new JPanel(); amortizationPanel.setLayout(new FlowLayout());
		 * amortizationTable.getTableHeader().setPreferredSize(new Dimension(10,
		 * 20)); amortizationPanel.add(amortizationTable.getTableHeader());
		 * amortizationPanel.setAutoscrolls(true); //sets scroll to auto
		 * amortizationPanel.add(scrollPane);
		 */
		/*
		 * Adding All Panels to the TopPanel in the Container and using a
		 * separator to separate them within in the GUI container
		 */

		topPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 20));
		topPanel.add(namePanel);
		JSeparator sep = new JSeparator();
		sep.setPreferredSize(new Dimension(350, 1));
		topPanel.add(sep);

		topPanel.add(loanAmountPanel);
		JSeparator sep2 = new JSeparator();
		sep2.setPreferredSize(new Dimension(350, 2));
		topPanel.add(sep2);

		topPanel.add(loanTermInterestRatePanel);
		JSeparator sep3 = new JSeparator();
		sep3.setPreferredSize(new Dimension(350, 2));
		topPanel.add(sep3);

		topPanel.add(comboPanel);
		JSeparator sep4 = new JSeparator();
		sep4.setPreferredSize(new Dimension(350, 2));
		topPanel.add(sep4);
		topPanel.add(buttonsPanel);
		// topPanel.add(amortizationPanel);

		/*
		 * Assiging size and dimensions to the pane Creates preferred sizes in
		 * the layout
		 */
		setPreferredSize(new Dimension(500, 850));
		setMinimumSize(new Dimension(500, 850));
		setResizable(false);
		setContentPane(topPanel);
		pack();
	}

	// @throws HeadlessException

	private void doIt() throws HeadlessException {

		double amount = 0, term = 0, interest = 0;

		try {

			amount = Double.parseDouble(loanAmountField.getText());

			if (customOptRadioButton.isSelected()) {
				term = Double.parseDouble(loanTermField.getText());

				interest = Double.parseDouble(interestRateField.getText());
			}
			// Switch cases being used to choose between the fixed options
			else {
				switch (interestRateAndLoanTermComboBox.getSelectedIndex()) {

				case 0:
					term = loanTerm[0];
					interest = interestRates[0];

					break;

				case 1:
					term = loanTerm[1];
					interest = interestRates[1];

					break;

				case 2:
					term = loanTerm[2];
					interest = interestRates[2];

					break;

				default:

					break;
				}
			}

			// Will throw an exception if zeros are input in any field
			if (amount <= 0 || term <= 0 || interest <= 0)

				throw new NumberFormatException();

			// Calculations for payment amounts

			DecimalFormat fmt = new java.text.DecimalFormat("$0.00"); // sets
																		// decimal
																		// point
																		// with
																		// dollar
																		// value
			double payment = calculateMortgagePayment(amount, interest, term);
			paymentLabel.setText(fmt.format(payment));

			// Updates results in the table

			/*
			 * model = TableModelCreator.getTableModel(interest, term, amount,
			 * payment);
			 * model.addTableModelListener(WK4MortgageCalculatorGUI.this);
			 * model.fireTableChanged(new TableModelEvent(model));
			 */

		} catch (NumberFormatException e) { // exception handling of numbers

			JOptionPane.showMessageDialog(WK4MortgageCalculatorGUI.this,
					"!!! Invaild Entry !!!" + "\nPlease use valid inputs.",
					"INPUT ERROR", JOptionPane.ERROR_MESSAGE);
		}
	}

	// Mortgage payment calculations

	private double calculateMortgagePayment(double principal,
			double interestRate,

			double term) {

		// Initializing variables
		Double loanPeriod, principalValue, monthlyPayment;
		principalValue = principal;
		interestRate = interestRate / 12 / 100;
		loanPeriod = term * 12.0;
		monthlyPayment = principalValue
				* (interestRate / (1 - Math
						.pow((1 + interestRate), -loanPeriod)));

		return monthlyPayment;
	}
}

// public void tableChanged(TableModelEvent e) {
// throw new UnsupportedOperationException("Not supported yet.");
// }
// Creates the table and saves the data in the table

// private static class Calculator {

// private static Object[][] sevenYearLoan = new Object[7][3]; //object arrays
// private static Object[][] fifteenYearLoan = new Object[15][3];
// private static Object[][] thirtyYearLoan = new Object[30][3];

// Max term for manual input is 50 years
// private static Object [][] customsLoan = new Object[50][3];

// Returns a DefaultTableModel

/*
 * public static DefaultTableModel getTableModel(double rate, double years,
 * double loan, double monthly) {
 * 
 * customsLoan = new Object[(int) years][3]; DecimalFormat decimal = new
 * DecimalFormat("0.00"); DefaultTableModel model = new DefaultTableModel((int)
 * (years * 12), 4); Object[] titles = { "Payment#", "Payment", "Balance",
 * "Interest Paid" }; model.setColumnIdentifiers(titles); final int size =
 * model.getRowCount(); for (int index = 0; index < size; index++) {
 * 
 * // Setting up the table
 * 
 * model.setValueAt(index + 1, index, 0);
 * model.setValueAt(decimal.format(monthly), index, 1);
 * 
 * if (loan == 0) {
 * 
 * model.setValueAt(decimal.format(loan), index, 2);
 * 
 * break;
 * 
 * } else
 * 
 * model.setValueAt(decimal.format(loan), index, 2);
 * 
 * double interestPaidForThisPayment = loan * (rate / (100 * 12));
 * 
 * if (interestPaidForThisPayment > 0)
 * 
 * model.setValueAt(decimal.format(interestPaidForThisPayment), index, 3);
 * 
 * else
 * 
 * model.setValueAt(0, index, 3);
 * 
 * loan = loan - (monthly - interestPaidForThisPayment);
 * 
 * if (loan <= monthly) {
 * 
 * monthly = loan; loan = 0; } } //Loan Terms fixed and custom options data
 * saved
 * 
 * if (years == 7) savesevenYear(model);
 * 
 * else if (years == 15) savefifteenYear(model);
 * 
 * else if (years == 30) savethirtyYear(model);
 * 
 * else saveCustomYears(model);
 * 
 * return model; } // Array data is saved in this section
 * 
 * private static void savesevenYear(DefaultTableModel model) {
 * 
 * for (int a = 0; a < sevenYearLoan.length; a++)
 * 
 * for (int b = 0; b < sevenYearLoan[a].length; b++)
 * 
 * sevenYearLoan[a][b] = model.getValueAt(a, b); } private static void
 * savefifteenYear(DefaultTableModel model) {
 * 
 * for (int a = 0; a < fifteenYearLoan.length; a++)
 * 
 * for (int b = 0; b < fifteenYearLoan[a].length; b++)
 * 
 * fifteenYearLoan[a][b] = model.getValueAt(a, b); } private static void
 * savethirtyYear(DefaultTableModel model) {
 * 
 * for (int a = 0; a < thirtyYearLoan.length; a++)
 * 
 * for (int b = 0; b < thirtyYearLoan[a].length; b++)
 * 
 * thirtyYearLoan[a][b] = model.getValueAt(a, b); } private static void
 * saveCustomYears(DefaultTableModel model) {
 * 
 * for(int a=0;a<customsLoan.length;a++)
 * 
 * for(int b=0;b<customsLoan[a].length;b++)
 * 
 * customsLoan[a][b] = model.getValueAt(a, b); } } /* // Updates the table with
 * input changes
 * 
 * public void tableChanged(TableModelEvent e) {
 * 
 * amortizationTable.setModel(model); amortizationTable.repaint();
 */

// } //End Program

Open in new window

0
 
objectsCommented:
looks like you accidentally commented it out.
the code i posted above should compile now
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
IchigoMDAuthor Commented:
It still is compiling with errors
0
 
objectsCommented:
are you using the code i posted above? it compiles fine here
0
 
for_yanCommented:
once you add the brace before line  private double calculateMortgagePayment it compiles nicely.
calc.PNG
0
 
IchigoMDAuthor Commented:
Below is what I am getting and it does not show the GUI now.

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
        at WK4MortgageCalculatorGUI.initComponents(WK4MortgageCalculatorGUI.java:92)
        at WK4MortgageCalculatorGUI.<init>(WK4MortgageCalculatorGUI.java:83)
        at WK4MortgageCalculatorGUI.main(WK4MortgageCalculatorGUI.java:32)
Java Result: 1
0
 
for_yanCommented:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
//import javax.swing.JScrollPane;
import javax.swing.JSeparator;
//import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
// import javax.swing.event.TableModelEvent;
//import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableModel;

public class WK4MortgageCalculatorGUI extends JFrame /*implements TableModelListener*/ {

    public static void main(String[] args) {        //Calling Main Method

    WK4MortgageCalculatorGUI frame = new WK4MortgageCalculatorGUI();  // Frame creation for GUI

  // set title and default close operation
       frame.setTitle("McBride Financial Services' Mortgage Calculator");
       frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
       frame.setVisible(true);
    }
 // Setting Array Variables
    private double[] loanTerm = { 7, 15, 30 };         // Loan Term Years for Array
    private double[] interestRates = { 5.35, 5.5, 5.75 };   // Interest Rates for Array
    //Panels Container Setup
    //Top container
    private JPanel topPanel;
    //Name Panel
    private JPanel namePanel;
    private JLabel nameLabel;
   // Loan Amount Pane
    private JPanel loanAmountPanel;
    private JLabel loanAmountLabel;
    private JTextField loanAmountField;
    private ButtonGroup buttonGroup;
    private JRadioButton fixedOptRadioButton;
    private JRadioButton customOptRadioButton;
  // Loan Term and Interest Rate Panel
    private JPanel loanTermInterestRatePanel;
    private JLabel loanTermLabel;
    private JTextField loanTermField;
    private JLabel interestRateLabel;
    private JTextField interestRateField;
  // Panel for Interest Rate and loan Term
    private JPanel comboPanel;
    private JLabel interestRateAndLoanTermLabel;
    private JComboBox interestRateAndLoanTermComboBox;
  //Calculate and Reset Button Panel
    private JPanel buttonsPanel;
    private JButton ResetButton;
    private JButton CalculateButton;
    private JLabel monthlyPaymentLabel;
    private JLabel paymentLabel;

// Table Components
   // private JPanel amortizationPanel;
    //private JTable amortizationTable;
   // private DefaultTableModel model;
   // private JScrollPane scrollPane;
    public WK4MortgageCalculatorGUI() {
    initComponents();
    }

    private void initComponents() {
        namePanel = new JPanel(new GridLayout(1,2));
        nameLabel = new JLabel("Welcome to McBride's Mortgage Calculator");
        loanAmountPanel = new JPanel(new GridLayout(2, 2));
        loanAmountLabel = new JLabel("Loan Amount:");
        loanAmountField = new JTextField(10);
        loanAmountField.setBackground(Color.lightGray);
        buttonGroup = new ButtonGroup();
        customOptRadioButton = new JRadioButton("Custom Option");
       //Allows User to chose which option to use
        customOptRadioButton.addActionListener(new ActionListener() {
         //   @Override

  //Enables the fields for use
    public void actionPerformed(ActionEvent arg0) {
        interestRateAndLoanTermLabel.setEnabled(false);
        interestRateAndLoanTermComboBox.setEnabled(false);
        loanTermLabel.setEnabled(true);
        loanTermField.setEnabled(true);
        interestRateLabel.setEnabled(true);
        interestRateField.setEnabled(true);
     }
    });
     // customOpt is selected as default Week 4 option
     //  customOptRadioButton.setSelected(false);// Week 4 option
       fixedOptRadioButton = new JRadioButton("Fixed Option");
       fixedOptRadioButton.setSelected(true);
       fixedOptRadioButton.addActionListener(new ActionListener() {
           // @Override

    //Enables the fields for use
    public void actionPerformed(ActionEvent arg0) {
          loanTermLabel.setEnabled(false);
          loanTermField.setEnabled(false);
          interestRateLabel.setEnabled(false);
          interestRateField.setEnabled(false);
          interestRateAndLoanTermLabel.setEnabled(true);
          interestRateAndLoanTermComboBox.setEnabled(true);
     }
    });
  // Buttons that allow user to chose
          namePanel.add(nameLabel);
          buttonGroup.add(customOptRadioButton);
          buttonGroup.add(fixedOptRadioButton);
          loanAmountPanel.add(loanAmountLabel);
          loanAmountPanel.add(loanAmountField);
          loanAmountPanel.add(customOptRadioButton);
          loanAmountPanel.add(fixedOptRadioButton);

 // Creates the Panel for Loan term and Interest Rates
          loanTermInterestRatePanel = new JPanel(new FlowLayout());
          loanTermLabel = new JLabel("Loan Term:");
          loanTermField = new JTextField(10);
          loanTermField.setBackground(Color.lightGray);
          interestRateLabel = new JLabel("Interest Rate: ");
          interestRateField = new JTextField(10);
          interestRateField.setBackground(Color.lightGray);
          //interestRateField.setBorder((Border) Color.black);
          loanTermInterestRatePanel.add(loanTermLabel);
          loanTermInterestRatePanel.add(loanTermField);
          loanTermInterestRatePanel.add(interestRateLabel);
          loanTermInterestRatePanel.add(interestRateField);
// Creates the Panel for Fixed Rate Option
          comboPanel = new JPanel(new GridLayout());
          interestRateAndLoanTermLabel = new JLabel("Fixed Loan Term & Interest Rates:  ");
          Object[] items = {"7 Years at 5.35%", "15 Years at 5.50%", "30 Years at 5.75%"};
          interestRateAndLoanTermComboBox = new JComboBox(items);
          interestRateAndLoanTermComboBox.setBackground(Color.cyan);
          comboPanel.add(interestRateAndLoanTermLabel);
          comboPanel.add(interestRateAndLoanTermComboBox);
//Creates the Fixed Rate Option as the default option on start up
         interestRateAndLoanTermComboBox.setEnabled(true);
// Reset and Calculate Button Panel placing Buttons next to each other
         buttonsPanel = new JPanel(new GridLayout(2, 2));
         ResetButton = new JButton("Reset");
         ResetButton.setBackground(Color.yellow);
         ResetButton.addActionListener(new ActionListener() { //Clears the field so the user can start all over

         //    @Override

     public void actionPerformed(ActionEvent arg0) {
          loanAmountField.setText("");
          loanTermField.setText("");
          interestRateField.setText("");
          paymentLabel.setText("");
         // DefaultTableModel dm = (DefaultTableModel)amortizationTable.getModel();
            //    dm.getDataVector().removeAllElements();
             }
       });
        CalculateButton = new JButton("Calculate");
        CalculateButton.setBackground(Color.green);
        CalculateButton.addActionListener(new ActionListener() { //Calculates the to give user a monthly payout and a tabel to show payments over the term

       //     @Override

       public void actionPerformed(ActionEvent e) {

                 doIt();

           }

        });

       monthlyPaymentLabel = new JLabel("Monthly Payment:");
       paymentLabel = new JLabel("");
       paymentLabel.setHorizontalAlignment(SwingConstants.TRAILING);

       buttonsPanel.add(CalculateButton);
       buttonsPanel.add(ResetButton);
       buttonsPanel.add(monthlyPaymentLabel);
       buttonsPanel.add(paymentLabel);

/*  //Creates the table for the transaction results and adds it to the pane
         amortizationTable = new JTable();
         model = new DefaultTableModel();
         model.addTableModelListener(this);
         model.fireTableChanged(new TableModelEvent(model));
         amortizationTable.setModel(model);
         amortizationTable.setAutoscrolls(true);
         scrollPane = new JScrollPane();
         scrollPane.getViewport().add(amortizationTable);
         scrollPane.setViewportView(amortizationTable);
         amortizationPanel = new JPanel();
         amortizationPanel.setLayout(new FlowLayout());
         amortizationTable.getTableHeader().setPreferredSize(new Dimension(10, 20));
         amortizationPanel.add(amortizationTable.getTableHeader());
         amortizationPanel.setAutoscrolls(true);         //sets scroll to auto
         amortizationPanel.add(scrollPane);
*/
 /* Adding All Panels to the TopPanel in the Container
 and using a separator to separate them within in the GUI container */

        topPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,0,20));
        topPanel.add(namePanel);
        JSeparator sep = new JSeparator();
        sep.setPreferredSize(new Dimension(350, 1));
        topPanel.add(sep);

        topPanel.add(loanAmountPanel);
        JSeparator sep2 = new JSeparator();
        sep2.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep2);

        topPanel.add(loanTermInterestRatePanel);
        JSeparator sep3 = new JSeparator();
        sep3.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep3);

        topPanel.add(comboPanel);
        JSeparator sep4 = new JSeparator();
        sep4.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep4);
        topPanel.add(buttonsPanel);
      //  topPanel.add(amortizationPanel);

/* Assiging size and dimensions to the pane
   Creates preferred sizes in the layout*/
        setPreferredSize(new Dimension(500, 850));
        setMinimumSize(new Dimension(500,850));
        setResizable(false);
        setContentPane(topPanel);
       pack();
    }

// @throws HeadlessException

    private void doIt() throws HeadlessException {

        double amount = 0, term = 0, interest = 0;

       try {

            amount = Double.parseDouble(loanAmountField.getText());

            if(customOptRadioButton.isSelected())
        {
                term = Double.parseDouble(loanTermField.getText());

                interest = Double.parseDouble(interestRateField.getText());
          }
          //Switch cases being used to choose between the fixed options
             else {
                switch (interestRateAndLoanTermComboBox.getSelectedIndex()) {

                    case 0:
                    term = loanTerm[0];
                    interest = interestRates[0];

                    break;

               case 1:
                    term = loanTerm[1];
                    interest = interestRates[1];

                    break;

                case 2:
                    term = loanTerm[2];
                    interest = interestRates[2];

                    break;

                default:

                    break;
                }
           }

    // Will throw an exception if zeros are input in any field
           if(amount <= 0 || term <= 0 || interest <= 0)

                    throw new NumberFormatException();

   // Calculations for payment amounts

          DecimalFormat fmt = new java.text.DecimalFormat ("$0.00");   //sets decimal point with dollar value
          double payment = calculateMortgagePayment(amount, interest, term);
          paymentLabel.setText(fmt.format(payment));

 // Updates results in the table

 /*      model = TableModelCreator.getTableModel(interest, term, amount, payment);
       model.addTableModelListener(WK4MortgageCalculatorGUI.this);
       model.fireTableChanged(new TableModelEvent(model));*/

    } catch (NumberFormatException e) {   //exception handling of numbers

    JOptionPane.showMessageDialog(WK4MortgageCalculatorGUI.this,"!!! Invaild Entry !!!" +
    "\nPlease use valid inputs.","INPUT ERROR", JOptionPane.ERROR_MESSAGE);
       // }
    }
    }
// Mortgage payment calculations

     private double calculateMortgagePayment(double principal, double interestRate,

             double term ) {

 //Initializing variables
        Double  loanPeriod, principalValue, monthlyPayment;
        principalValue = principal;
        interestRate = interestRate / 12 / 100;
        loanPeriod = term * 12.0;
        monthlyPayment = principalValue * (interestRate / (1 - Math.pow((1 + interestRate), -loanPeriod)));

        return monthlyPayment;
    }}

//    public void tableChanged(TableModelEvent e) {
//        throw new UnsupportedOperationException("Not supported yet.");
//    }
 // Creates the table and saves the data in the table

 // private static class Calculator {

   //     private static Object[][] sevenYearLoan = new Object[7][3];    //object arrays
  //      private static Object[][] fifteenYearLoan = new Object[15][3];
   //     private static Object[][] thirtyYearLoan = new Object[30][3];

// Max term for manual input is 50 years
 //       private static Object [][] customsLoan = new Object[50][3];

// Returns a DefaultTableModel

      /*  public static DefaultTableModel getTableModel(double rate, double years, double loan, double monthly) {

            customsLoan = new Object[(int) years][3];
            DecimalFormat decimal = new DecimalFormat("0.00");
            DefaultTableModel model = new DefaultTableModel((int) (years * 12), 4);
            Object[] titles = { "Payment#", "Payment", "Balance", "Interest Paid" };
            model.setColumnIdentifiers(titles);
            final int size = model.getRowCount();
            for (int index = 0; index < size; index++) {

  // Setting up the table

             model.setValueAt(index + 1, index, 0);
            model.setValueAt(decimal.format(monthly), index, 1);

              if (loan == 0) {

                  model.setValueAt(decimal.format(loan), index, 2);

                   break;

               } else

               model.setValueAt(decimal.format(loan), index, 2);

               double interestPaidForThisPayment = loan * (rate / (100 * 12));

     if (interestPaidForThisPayment > 0)

    model.setValueAt(decimal.format(interestPaidForThisPayment), index, 3);

           else

               model.setValueAt(0, index, 3);

               loan = loan - (monthly - interestPaidForThisPayment);

                if (loan <= monthly) {

                monthly = loan;
                loan = 0;
        }
   }
  //Loan Terms fixed and custom options data saved

           if (years == 7)
               savesevenYear(model);

           else if (years == 15)
                savefifteenYear(model);

           else if (years == 30)
                savethirtyYear(model);

           else
              saveCustomYears(model);

         return model;
   }
   // Array data is saved in this section

    private static void savesevenYear(DefaultTableModel model) {

        for (int a = 0; a < sevenYearLoan.length; a++)

            for (int b = 0; b < sevenYearLoan[a].length; b++)

                 sevenYearLoan[a][b] = model.getValueAt(a, b);
    }
     private static void savefifteenYear(DefaultTableModel model) {

       for (int a = 0; a < fifteenYearLoan.length; a++)

          for (int b = 0; b < fifteenYearLoan[a].length; b++)

               fifteenYearLoan[a][b] = model.getValueAt(a, b);
       }
      private static void savethirtyYear(DefaultTableModel model) {

         for (int a = 0; a < thirtyYearLoan.length; a++)

            for (int b = 0; b < thirtyYearLoan[a].length; b++)

              thirtyYearLoan[a][b] = model.getValueAt(a, b);
   }
     private static void saveCustomYears(DefaultTableModel model) {

        for(int a=0;a<customsLoan.length;a++)

               for(int b=0;b<customsLoan[a].length;b++)

              customsLoan[a][b] = model.getValueAt(a, b);
     }
   }
/*  // Updates the table with input changes

   public void tableChanged(TableModelEvent e) {

      amortizationTable.setModel(model);
      amortizationTable.repaint();*/

//} //End Program

Open in new window

0
 
for_yanCommented:
Check the code I posted - it compiles as you can see
0
 
for_yanCommented:
remove all  four @override
you don't need them
0
 
for_yanCommented:
or just use my code
0
 
IchigoMDAuthor Commented:
It still saying that there is an error, when compiling
0
 
for_yanCommented:
are you using my code - you saw that I compiled it?

Where is the error?
0
 
for_yanCommented:
for @override at line 92 you prtobably need to have version 6.0 of the compiler
my compiler also compained, because I use 1.5
but without overriddes it does not show any errors
0
 
objectsCommented:
thats a problem with your ide. The code I posted compiles fine
goto your project and do a clean build and run it again.

and you should keep the override lines, they are important and lets the compiler pick ip errors
0
 
IchigoMDAuthor Commented:
Thanks for the help it is working the way I want. You're awesome. Amazing what one little bracket will do.
0
 
objectsCommented:
ie use the code I posted exactly as is, it will work fine
0
 
objectsCommented:
why did you accept that comment?
the code for_yan posted is just a copy of what I posted, there is absolutely no diffeernce

please explain
0
 
IchigoMDAuthor Commented:
How would I add an exit button
0
 
objectsCommented:
can you first explain why you ignored the code I posted, and instead accepted a copy?
0
 
for_yanCommented:
I'll show you how to add an ExitButton in a few minutes
0
 
for_yanCommented:
I didn't post any copies, objects, be reasonable after all
0
 
objectsCommented:
> I didn't post any copies, objects, be reasonable after all

its exactly the same, which is not permitted at EE
0
 
for_yanCommented:
This is with exit button:

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
//import javax.swing.JScrollPane;
import javax.swing.JSeparator;
//import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
// import javax.swing.event.TableModelEvent;
//import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableModel;

public class WK4MortgageCalculatorGUI extends JFrame /*implements TableModelListener*/ {

    public static void main(String[] args) {        //Calling Main Method

    WK4MortgageCalculatorGUI frame = new WK4MortgageCalculatorGUI();  // Frame creation for GUI

  // set title and default close operation
       frame.setTitle("McBride Financial Services' Mortgage Calculator");
       frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
       frame.setVisible(true);
    }
 // Setting Array Variables
    private double[] loanTerm = { 7, 15, 30 };         // Loan Term Years for Array
    private double[] interestRates = { 5.35, 5.5, 5.75 };   // Interest Rates for Array
    //Panels Container Setup
    //Top container
    private JPanel topPanel;
    //Name Panel
    private JPanel namePanel;
    private JLabel nameLabel;
   // Loan Amount Pane
    private JPanel loanAmountPanel;
    private JLabel loanAmountLabel;
    private JTextField loanAmountField;
    private ButtonGroup buttonGroup;
    private JRadioButton fixedOptRadioButton;
    private JRadioButton customOptRadioButton;
  // Loan Term and Interest Rate Panel
    private JPanel loanTermInterestRatePanel;
    private JLabel loanTermLabel;
    private JTextField loanTermField;
    private JLabel interestRateLabel;
    private JTextField interestRateField;
  // Panel for Interest Rate and loan Term
    private JPanel comboPanel;
    private JLabel interestRateAndLoanTermLabel;
    private JComboBox interestRateAndLoanTermComboBox;
  //Calculate and Reset Button Panel
    private JPanel buttonsPanel;
    private JButton ResetButton;
    private JButton CalculateButton;
    private JButton ExitButton;
    private JLabel monthlyPaymentLabel;
    private JLabel paymentLabel;

// Table Components
   // private JPanel amortizationPanel;
    //private JTable amortizationTable;
   // private DefaultTableModel model;
   // private JScrollPane scrollPane;
    public WK4MortgageCalculatorGUI() {
    initComponents();
    }

    private void initComponents() {
        namePanel = new JPanel(new GridLayout(1,2));
        nameLabel = new JLabel("Welcome to McBride's Mortgage Calculator");
        loanAmountPanel = new JPanel(new GridLayout(2, 2));
        loanAmountLabel = new JLabel("Loan Amount:");
        loanAmountField = new JTextField(10);
        loanAmountField.setBackground(Color.lightGray);
        buttonGroup = new ButtonGroup();
        customOptRadioButton = new JRadioButton("Custom Option");
       //Allows User to chose which option to use
        customOptRadioButton.addActionListener(new ActionListener() {
         //   @Override

  //Enables the fields for use
    public void actionPerformed(ActionEvent arg0) {
        interestRateAndLoanTermLabel.setEnabled(false);
        interestRateAndLoanTermComboBox.setEnabled(false);
        loanTermLabel.setEnabled(true);
        loanTermField.setEnabled(true);
        interestRateLabel.setEnabled(true);
        interestRateField.setEnabled(true);
     }
    });
     // customOpt is selected as default Week 4 option
     //  customOptRadioButton.setSelected(false);// Week 4 option
       fixedOptRadioButton = new JRadioButton("Fixed Option");
       fixedOptRadioButton.setSelected(true);
       fixedOptRadioButton.addActionListener(new ActionListener() {
           // @Override

    //Enables the fields for use
    public void actionPerformed(ActionEvent arg0) {
          loanTermLabel.setEnabled(false);
          loanTermField.setEnabled(false);
          interestRateLabel.setEnabled(false);
          interestRateField.setEnabled(false);
          interestRateAndLoanTermLabel.setEnabled(true);
          interestRateAndLoanTermComboBox.setEnabled(true);
     }
    });
  // Buttons that allow user to chose
          namePanel.add(nameLabel);
          buttonGroup.add(customOptRadioButton);
          buttonGroup.add(fixedOptRadioButton);
          loanAmountPanel.add(loanAmountLabel);
          loanAmountPanel.add(loanAmountField);
          loanAmountPanel.add(customOptRadioButton);
          loanAmountPanel.add(fixedOptRadioButton);

 // Creates the Panel for Loan term and Interest Rates
          loanTermInterestRatePanel = new JPanel(new FlowLayout());
          loanTermLabel = new JLabel("Loan Term:");
          loanTermField = new JTextField(10);
          loanTermField.setBackground(Color.lightGray);
          interestRateLabel = new JLabel("Interest Rate: ");
          interestRateField = new JTextField(10);
          interestRateField.setBackground(Color.lightGray);
          //interestRateField.setBorder((Border) Color.black);
          loanTermInterestRatePanel.add(loanTermLabel);
          loanTermInterestRatePanel.add(loanTermField);
          loanTermInterestRatePanel.add(interestRateLabel);
          loanTermInterestRatePanel.add(interestRateField);
// Creates the Panel for Fixed Rate Option
          comboPanel = new JPanel(new GridLayout());
          interestRateAndLoanTermLabel = new JLabel("Fixed Loan Term & Interest Rates:  ");
          Object[] items = {"7 Years at 5.35%", "15 Years at 5.50%", "30 Years at 5.75%"};
          interestRateAndLoanTermComboBox = new JComboBox(items);
          interestRateAndLoanTermComboBox.setBackground(Color.cyan);
          comboPanel.add(interestRateAndLoanTermLabel);
          comboPanel.add(interestRateAndLoanTermComboBox);
//Creates the Fixed Rate Option as the default option on start up
         interestRateAndLoanTermComboBox.setEnabled(true);
// Reset and Calculate Button Panel placing Buttons next to each other
         buttonsPanel = new JPanel(new GridLayout(2, 2));
        ExitButton = new JButton("Exit");
        ExitButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
                System.exit(0);
            }
        });

        
         ResetButton = new JButton("Reset");
         ResetButton.setBackground(Color.yellow);

         ResetButton.addActionListener(new ActionListener() { //Clears the field so the user can start all over

         //    @Override

     public void actionPerformed(ActionEvent arg0) {
          loanAmountField.setText("");
          loanTermField.setText("");
          interestRateField.setText("");
          paymentLabel.setText("");
         // DefaultTableModel dm = (DefaultTableModel)amortizationTable.getModel();
            //    dm.getDataVector().removeAllElements();
             }
       });
        CalculateButton = new JButton("Calculate");
        CalculateButton.setBackground(Color.green);
        CalculateButton.addActionListener(new ActionListener() { //Calculates the to give user a monthly payout and a tabel to show payments over the term

       //     @Override

       public void actionPerformed(ActionEvent e) {

                 doIt();

           }

        });

       monthlyPaymentLabel = new JLabel("Monthly Payment:");
       paymentLabel = new JLabel("");
       paymentLabel.setHorizontalAlignment(SwingConstants.TRAILING);

       buttonsPanel.add(CalculateButton);
       buttonsPanel.add(ResetButton);
      buttonsPanel.add(ExitButton);        
       buttonsPanel.add(monthlyPaymentLabel);
       buttonsPanel.add(paymentLabel);

/*  //Creates the table for the transaction results and adds it to the pane
         amortizationTable = new JTable();
         model = new DefaultTableModel();
         model.addTableModelListener(this);
         model.fireTableChanged(new TableModelEvent(model));
         amortizationTable.setModel(model);
         amortizationTable.setAutoscrolls(true);
         scrollPane = new JScrollPane();
         scrollPane.getViewport().add(amortizationTable);
         scrollPane.setViewportView(amortizationTable);
         amortizationPanel = new JPanel();
         amortizationPanel.setLayout(new FlowLayout());
         amortizationTable.getTableHeader().setPreferredSize(new Dimension(10, 20));
         amortizationPanel.add(amortizationTable.getTableHeader());
         amortizationPanel.setAutoscrolls(true);         //sets scroll to auto
         amortizationPanel.add(scrollPane);
*/
 /* Adding All Panels to the TopPanel in the Container
 and using a separator to separate them within in the GUI container */

        topPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,0,20));
        topPanel.add(namePanel);
        JSeparator sep = new JSeparator();
        sep.setPreferredSize(new Dimension(350, 1));
        topPanel.add(sep);

        topPanel.add(loanAmountPanel);
        JSeparator sep2 = new JSeparator();
        sep2.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep2);

        topPanel.add(loanTermInterestRatePanel);
        JSeparator sep3 = new JSeparator();
        sep3.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep3);

        topPanel.add(comboPanel);
        JSeparator sep4 = new JSeparator();
        sep4.setPreferredSize(new Dimension(350, 2));
        topPanel.add(sep4);
        topPanel.add(buttonsPanel);
      //  topPanel.add(amortizationPanel);

/* Assiging size and dimensions to the pane
   Creates preferred sizes in the layout*/
        setPreferredSize(new Dimension(500, 850));
        setMinimumSize(new Dimension(500,850));
        setResizable(false);
        setContentPane(topPanel);
       pack();
    }

// @throws HeadlessException

    private void doIt() throws HeadlessException {

        double amount = 0, term = 0, interest = 0;

       try {

            amount = Double.parseDouble(loanAmountField.getText());

            if(customOptRadioButton.isSelected())
        {
                term = Double.parseDouble(loanTermField.getText());

                interest = Double.parseDouble(interestRateField.getText());
          }
          //Switch cases being used to choose between the fixed options
             else {
                switch (interestRateAndLoanTermComboBox.getSelectedIndex()) {

                    case 0:
                    term = loanTerm[0];
                    interest = interestRates[0];

                    break;

               case 1:
                    term = loanTerm[1];
                    interest = interestRates[1];

                    break;

                case 2:
                    term = loanTerm[2];
                    interest = interestRates[2];

                    break;

                default:

                    break;
                }
           }

    // Will throw an exception if zeros are input in any field
           if(amount <= 0 || term <= 0 || interest <= 0)

                    throw new NumberFormatException();

   // Calculations for payment amounts

          DecimalFormat fmt = new java.text.DecimalFormat ("$0.00");   //sets decimal point with dollar value
          double payment = calculateMortgagePayment(amount, interest, term);
          paymentLabel.setText(fmt.format(payment));

 // Updates results in the table

 /*      model = TableModelCreator.getTableModel(interest, term, amount, payment);
       model.addTableModelListener(WK4MortgageCalculatorGUI.this);
       model.fireTableChanged(new TableModelEvent(model));*/

    } catch (NumberFormatException e) {   //exception handling of numbers

    JOptionPane.showMessageDialog(WK4MortgageCalculatorGUI.this,"!!! Invaild Entry !!!" +
    "\nPlease use valid inputs.","INPUT ERROR", JOptionPane.ERROR_MESSAGE);
       // }
    }
    }
// Mortgage payment calculations

     private double calculateMortgagePayment(double principal, double interestRate,

             double term ) {

 //Initializing variables
        Double  loanPeriod, principalValue, monthlyPayment;
        principalValue = principal;
        interestRate = interestRate / 12 / 100;
        loanPeriod = term * 12.0;
        monthlyPayment = principalValue * (interestRate / (1 - Math.pow((1 + interestRate), -loanPeriod)));

        return monthlyPayment;
    }}

//    public void tableChanged(TableModelEvent e) {
//        throw new UnsupportedOperationException("Not supported yet.");
//    }
 // Creates the table and saves the data in the table

 // private static class Calculator {

   //     private static Object[][] sevenYearLoan = new Object[7][3];    //object arrays
  //      private static Object[][] fifteenYearLoan = new Object[15][3];
   //     private static Object[][] thirtyYearLoan = new Object[30][3];

// Max term for manual input is 50 years
 //       private static Object [][] customsLoan = new Object[50][3];

// Returns a DefaultTableModel

      /*  public static DefaultTableModel getTableModel(double rate, double years, double loan, double monthly) {

            customsLoan = new Object[(int) years][3];
            DecimalFormat decimal = new DecimalFormat("0.00");
            DefaultTableModel model = new DefaultTableModel((int) (years * 12), 4);
            Object[] titles = { "Payment#", "Payment", "Balance", "Interest Paid" };
            model.setColumnIdentifiers(titles);
            final int size = model.getRowCount();
            for (int index = 0; index < size; index++) {

  // Setting up the table

             model.setValueAt(index + 1, index, 0);
            model.setValueAt(decimal.format(monthly), index, 1);

              if (loan == 0) {

                  model.setValueAt(decimal.format(loan), index, 2);

                   break;

               } else

               model.setValueAt(decimal.format(loan), index, 2);

               double interestPaidForThisPayment = loan * (rate / (100 * 12));

     if (interestPaidForThisPayment > 0)

    model.setValueAt(decimal.format(interestPaidForThisPayment), index, 3);

           else

               model.setValueAt(0, index, 3);

               loan = loan - (monthly - interestPaidForThisPayment);

                if (loan <= monthly) {

                monthly = loan;
                loan = 0;
        }
   }
  //Loan Terms fixed and custom options data saved

           if (years == 7)
               savesevenYear(model);

           else if (years == 15)
                savefifteenYear(model);

           else if (years == 30)
                savethirtyYear(model);

           else
              saveCustomYears(model);

         return model;
   }
   // Array data is saved in this section

    private static void savesevenYear(DefaultTableModel model) {

        for (int a = 0; a < sevenYearLoan.length; a++)

            for (int b = 0; b < sevenYearLoan[a].length; b++)

                 sevenYearLoan[a][b] = model.getValueAt(a, b);
    }
     private static void savefifteenYear(DefaultTableModel model) {

       for (int a = 0; a < fifteenYearLoan.length; a++)

          for (int b = 0; b < fifteenYearLoan[a].length; b++)

               fifteenYearLoan[a][b] = model.getValueAt(a, b);
       }
      private static void savethirtyYear(DefaultTableModel model) {

         for (int a = 0; a < thirtyYearLoan.length; a++)

            for (int b = 0; b < thirtyYearLoan[a].length; b++)

              thirtyYearLoan[a][b] = model.getValueAt(a, b);
   }
     private static void saveCustomYears(DefaultTableModel model) {

        for(int a=0;a<customsLoan.length;a++)

               for(int b=0;b<customsLoan[a].length;b++)

              customsLoan[a][b] = model.getValueAt(a, b);
     }
   }
/*  // Updates the table with input changes

   public void tableChanged(TableModelEvent e) {

      amortizationTable.setModel(model);
      amortizationTable.repaint();*/

//} //End Program

Open in new window

0
 
for_yanCommented:
It cannot be exactly the same - I commented out @override from the very beginning - you can check - that's why it compiled for the author
from the first time, I wrote it already.
Otherwise we started form the same code - I posted first where you need to put the brace.
They cannot be much ifferent.
What else  do you need?

And how long can you keep making everyone's life miserable?
Where do you get all this hostility?  
0
 
IchigoMDAuthor Commented:
I'm sorry Objects, thought I was working with one person, was not paying attention. Forgive me. I appreciate your help I used both and they compile when I ran them through another IDE. You were correct. Once  again i apologize. I would like to grade you also if possible.
0
 
for_yanCommented:
modus_in_rebus,
You should not influence the decision of the author;
if he really wanted to change, he would have requested it himself.
This is the behavior not approprite for neutrality, which one believe moderator should maintain.
0
 
for_yanCommented:
That was his remark; if he wanted he would have taken action.
This issue was about one misplaced brace; I posted the solution first at http:#35751700
The was not relevant - the solution was achieved at that point.
There were dosens of cases like that with opposite roles, I never contested
any of them.
There is no reason to influence the author to change his decision;
this is especaily inappropriate for anyone who has the function of moderator.
0
 
IchigoMDAuthor Commented:
I am sorry for all the trouble I caused. I will pay better attention next time. I was not influenced. I did think it was one person until I went back and looked at the conversations. I do thank both of you.. Once again I apologize
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 14
  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now