Computers & Internet Logo

Related Topics:

Posted on Nov 13, 2010

Code for a simple banking system. - Sun Java Programming Language (cdj-275)

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

  • Contributor 1 Answer
  • Posted on May 27, 2011
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Joined: May 27, 2011
Answers
1
Questions
0
Helped
447
Points
1

//My name is rajeshwari and i have posted u a simple Bank program
import java.awt.*;
import java.awt.event.*;
public class MyBank implements ActionListener,ItemListener
{
Frame f1;
CheckboxGroup cg1;
Checkbox ch1,ch2,ch3,ch4,ch5,ch6;
Label l1,l2,l3,l4,l5;
TextField t1,t2,t3,t4;
Button b1,b2,b3;
Font ft;

MyBank()
{
f1 = new Frame("My Bank");
f1.setBounds(50,50,500,500);
f1.setLayout(null);

cg1 = new CheckboxGroup();
ch1 = new Checkbox("Short term[1yr]",cg1,false);
ch1.setBounds(50,50,120,30);
ch1.addItemListener(this);
ch2 = new Checkbox("Medium term[2yrs]",cg1,false);
ch2.setBounds(50,100,120,30);
ch2.addItemListener(this);
ch3 = new Checkbox("Long term[5yrs]",cg1,false);
ch3.setBounds(50,150,120,30);
ch3.addItemListener(this);
ch4 = new Checkbox("Very long term[10yrs]",cg1,false);
ch4.setBounds(50,200,120,30);
ch4.addItemListener(this);

l1 = new Label("Rate of Interest");
l1.setBounds(210,50,150,30);
t1 = new TextField();
t1.setBounds(360,50,100,30);
l2 = new Label("Deposit Amount");
l2.setBounds(210,125,150,30);
t2 = new TextField();
t2.setBounds(360,125,100,30);
l3 = new Label("Interest Amount");
l3.setBounds(210,200,150,30);
t3 = new TextField();
t3.setBounds(360,200,100,30);
l4 = new Label("Maturity Amount");
l4.setBounds(210,275,150,30);
t4 = new TextField();
t4.setBounds(360,275,100,30);

ch5 = new Checkbox("Senior Citizens");
ch5.setBounds(125,320,100,30);
ch5.addItemListener(this);
ch6 = new Checkbox("NRI");
ch6.setBounds(275,320,100,30);
ch6.addItemListener(this);

l5 = new Label("Extra : 0.5 Rate of Interest on Sr.Citizens and 1 Rate of Interest on NRI");
l5.setBounds(50,370,400,30);

b1 = new Button("Calc");
b1.setBounds(125,440,50,30);
b1.addActionListener(this);
b2 = new Button("Clear");
b2.setBounds(225,440,50,30);
b2.addActionListener(this);
b3 = new Button("Exit");
b3.setBounds(325,440,50,30);
b3.addActionListener(this);

f1.addWindowListener(new mywin());
ft=new Font("Arial",Font.ITALIC,20);
f1.add(ch1);
f1.add(ch2);
f1.add(ch3);
f1.add(ch4);
f1.add(l1);
f1.add(t1);
f1.add(l2);
f1.add(t2);
f1.add(l3);
f1.add(t3);
f1.add(l4);
f1.add(t4);
f1.add(ch5);
f1.add(ch6);
f1.add(l5);
f1.add(b1);
f1.add(b2);
f1.add(b3);
f1.setVisible(true);
}
public class mywin extends WindowAdapter
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}
public void itemStateChanged(ItemEvent ie)
{
double r;

try{
if(ch1.getState() == true)
{
t1.setText("3.5");
}
else if(ch2.getState() == true)
{
t1.setText("4");
}
else if(ch3.getState() == true)
{
t1.setText("4.5");
}
else if(ch4.getState() == true)
{
t1.setText("5");
}

if(ch5.getState() == true)
{
r = 0.5 + Double.parseDouble(t1.getText());
t1.setText(r+"");
}

if(ch6.getState() == true)
{
r = 1 + Double.parseDouble(t1.getText());
t1.setText(r+"");
}
}catch(Exception e){
System.out.println(e);
}
}

public void actionPerformed(ActionEvent ae)
{
double ri,damt,in,mamt;
if(ae.getSource() == b1)
{
ri = Double.parseDouble(t1.getText());
damt = Double.parseDouble(t2.getText());

in = (damt * ri) / 100;
mamt = damt + in;

t3.setText(in+"");
t4.setText(mamt+"");
}
else if(ae.getSource() == b2)
{
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
ch5.setState(false);
ch6.setState(false);
}
else if(ae.getSource() == b3)
{
System.exit(0);
}
}
public static void main(String args[])
{
MyBank obj = new MyBank();
}
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

Verifone v240m bad mac problem please help

This means the Ingenico card machine has been disconnected by the bank (or the bank's systems have been updated which happens every 30 days) and you will need a simple "MAC reset" on the bank's system. A short call to a member of your banks support team will get this resolved and get the terminal back working.
0helpful
1answer

2002 saturn engine codes p0305,p0421 & p1818,what needs to be done to correct problem?

P0305 - Cylinder number 5 misfire detected.
Probable faults and reasons:
Igniter no. 5 defective.
Ignition system malfunction.
Spark plug is short or its air too wide. (0.9 - 1.1 mm)
Weak compression.
Valve clearance less than recommended.
Engine valves and seats defective.
Fuel pump pressure too high.
P0421 - Warm up catalytic efficiency is below threshold (Bank 1)
Probable faults and reasons:
Catalytic converter.
Heated oxygen Bank 1.sensor 1, 2.
P1818 - Manufacturer specific code.
4helpful
2answers

Ml350 replaced a/b cam position sensor reset computer & and erra codes p0016/p0016 check engine ligth is reset car drives with light off when engine is turn off and started the light goes out if you...

P0010....'A' Camshaft Position Actuator Circuit (Bank 1)

P0011....'A' Camshaft Position - Timing Over-Advanced or System Performance (Bank 1)

P0012....'A' Camshaft Position - Timing Over-Retarded (Bank 1)

P0013....'B' Camshaft Position - Actuator Circuit (Bank 1)

P0014....'B' Camshaft Position - Timing Over-Advanced or System Performance (Bank 1)

P0015....'B' Camshaft Position -Timing Over-Retarded (Bank 1)

P0020....'A' Camshaft Position Actuator Circuit (Bank 2)

P0021....'A' Camshaft Position - Timing Over-Advanced or System Performance (Bank 2)

P0022....'A' Camshaft Position - Timing Over-Retarded (Bank 2)

P0023....'B' Camshaft Position - Actuator Circuit (Bank 2)

P0024....'B' Camshaft Position - Timing Over-Advanced or System Performance (Bank 2)

P0025....'B' Camshaft Position - Timing Over-Retarded (Bank 2)

I think your sensors are pattern parts and the readings /resistances are not the same as the original parts ,try some bosch units is my first suggestion ,

0helpful
1answer

Engine computer reads code 133 and 137......need to know what it means. I have a 2002 daewoo laos

ok this one is simple code ( 133 ) is ( 02 sensor circuit slow response) ( bank 1 sensor 1) and code ( 137 ) is ( 02 sensor low voltage ) ( bank 1 sensor 2 )
12helpful
1answer

Generic code PO171 system 2 lean bank 1 generic

This can be caused by a faulty mass air flow sensor
0helpful
1answer

Hello my Audi A4 has several cades coming up P1479 something to do with the brake boost vaccum system P0322 engine rpm sensor P1128 bank 1 system too lean P1137 Bank 1 system too rich. Are these faults...

Yes If you have a vacuum leak it will pop the oxygen sensor codes to rich/ to lean. the rpm code is some thing different, it could be as simple as you over revving the car.
4helpful
2answers

Code 171 and engine light is on

--BANK 1 = DTCs P0171 (lean) and P0172 (rich)

-Check intake air system for leaks, obstructions and damage.
-Check air cleaner element, air cleaner housing for blockage.
-Verify integrity of the PCV system.
-Check for vacuum leaks.

I would try cleaning the Mass Airflow Sensor first. A dirty Mass Airflow Sensor is a common problem for triggering PO 171 & 174 codes.

Good luck and keep me posted.
2helpful
4answers

I get a DTC P0133 code on my 1998 Ford Explorer V8

it may be a defective O2 sensor here is th difinition:
P0133 - Heated Oxygen Sensor (HO2S) Slow Response Bank 1 Sensor 1 , this is the sensor on the side of the engine that #1 cylinder is on, it is the sensor before the cat.
0helpful
1answer

About c source code

Here is a simple example:
http://wiki.answers.com/Q/Write_a_C_program_for_simple_interest_calculation

3helpful
1answer

I am getting code P0171 system to lean, bank 1 ??

Bank 1 is the cylinder bank that has #1 in it. In your case I believe it is the cylinder bank at the front of the car, number 1 cylinder is to the far left looking at it from the front. The system lean condition could be caused by a leaking intake manifold gasket or a simple O2 sensor that is reading just out of range but not enough to trip a code for a faulty sensor.
Not finding what you are looking for?

457 views

Ask a Question

Usually answered in minutes!

Top Sun Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1480 Answers

k24674

Level 3 Expert

8093 Answers

Sean Wright
Sean Wright

Level 3 Expert

2045 Answers

Are you a Sun Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...