Sorry everyone i'm new to java and i have an assingment which i have hand over soon
i just want get an idea how to calculate car insurance premium based on the age,Licence and Engine size
this is my first time come in to this site even so..
if you just give me an hint i will be able to finish the rest my self
thank you very much in advanced
i will be very appreciated your help
here the code that i have so far
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.JComboBox;
import javax.swing.JCheckBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextPane;
import javax.swing.JTextArea;
import javax.swing.JButton;
public class Testinsurance {
private JFrame frame;
private JTextField textField;
private JTextField textField_1;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Testinsurance window = new Testinsurance();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public Testinsurance() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 629, 481);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JPanel Mainpanel = new JPanel();
Mainpanel.setBounds(0, 0, 613, 443);
frame.getContentPane().add(Mainpanel);
Mainpanel.setLayout(null);
JLabel lblNewLabel = new JLabel("Please Enter Your Name:");
lblNewLabel.setBounds(10, 29, 141, 17);
Mainpanel.add(lblNewLabel);
textField = new JTextField();
textField.setBounds(195, 26, 244, 17);
Mainpanel.add(textField);
textField.setColumns(10);
JLabel lblNewLabel_1 = new JLabel("Please Enter Your Age:");
lblNewLabel_1.setBounds(10, 75, 141, 14);
Mainpanel.add(lblNewLabel_1);
textField_1 = new JTextField();
textField_1.setBounds(195, 72, 86, 17);
Mainpanel.add(textField_1);
textField_1.setColumns(10);
JLabel lblNewLabel_2 = new JLabel("Please Choose Your Gender:");
lblNewLabel_2.setBounds(10, 129, 141, 17);
Mainpanel.add(lblNewLabel_2);
JRadioButton rdbtnNewRadioButton = new JRadioButton("Male");
rdbtnNewRadioButton.setBounds(193, 126, 109, 23);
Mainpanel.add(rdbtnNewRadioButton);
JRadioButton rdbtnNewRadioButton_1 = new JRadioButton("Female");
rdbtnNewRadioButton_1.setBounds(330, 126, 109, 23);
Mainpanel.add(rdbtnNewRadioButton_1);
JLabel lblNewLabel_3 = new JLabel("Your licence type: ");
lblNewLabel_3.setBounds(10, 186, 141, 17);
Mainpanel.add(lblNewLabel_3);
JCheckBox chckbxNewCheckBox = new JCheckBox("Full Irish");
chckbxNewCheckBox.setBounds(195, 183, 97, 23);
Mainpanel.add(chckbxNewCheckBox);
JCheckBox chckbxNewCheckBox_1 = new JCheckBox("Learning Permit");
chckbxNewCheckBox_1.setBounds(330, 183, 109, 23);
Mainpanel.add(chckbxNewCheckBox_1);
JLabel lblNewLabel_4 = new JLabel("Cover Type: ");
lblNewLabel_4.setBounds(10, 236, 97, 17);
Mainpanel.add(lblNewLabel_4);
JComboBox comboBoxCover = new JComboBox();
comboBoxCover.setBounds(195, 234, 132, 17);
comboBoxCover.setModel(new DefaultComboBoxModel(new String[] {"Compahensive", "Third Part Fire & Theift", "Thirdpart Only"}));
Mainpanel.add(comboBoxCover);
JLabel lblEngine = new JLabel("Your engine size is:");
lblEngine.setBounds(10, 294, 116, 17);
Mainpanel.add(lblEngine);
JComboBox comboBox = new JComboBox();
comboBox.setBounds(193, 292, 134, 19);
comboBox.setModel(new DefaultComboBoxModel(new String[] {"1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6"}));
Mainpanel.add(comboBox);
JTextArea textArea = new JTextArea();
textArea.setBounds(172, 338, 276, 94);
Mainpanel.add(textArea);
JButton btnGetC = new JButton("Get Quote");
btnGetC.setBounds(18, 384, 89, 23);
Mainpanel.add(btnGetC);
}
}