Question about Sun Java Programming Language (cdj-275)

1 Answer

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

Posted by on

Ad

1 Answer

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

//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();
}
}

Posted on May 27, 2011

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

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

×

Loading...
Loading...

Related Questions:

1 Answer

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.

Dec 21, 2013 | Cars & Trucks

1 Answer

I got codes p0455,p1421,p1423,p0141


code P0455......... Evaporative emission system leak detected ( large leak ) check gas cap

code 1451...........secondary air system leak ( bank 2 ) check for vacuum leak

code 1423...........secondary air system leak ( bank 1 ) check for vacuum leak

code 0141...........02 sensor heater circuit ( bank 1, sensor 2 ) replace 02 sensor

Mar 02, 2011 | 1997 BMW 328

2 Answers

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 ,

Nov 02, 2010 | Mercedes-Benz ML350 Cars & Trucks

1 Answer

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 )

Sep 15, 2010 | 2001 Daewoo Lanos

1 Answer

Generic code PO171 system 2 lean bank 1 generic


This can be caused by a faulty mass air flow sensor

Jul 06, 2010 | 1999 Ford Taurus

1 Answer

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.

Jun 14, 2010 | Cars & Trucks

2 Answers

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.

Oct 21, 2009 | Chevrolet Colorado Cars & Trucks

1 Answer

About c source code


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

Jan 09, 2009 | Computers & Internet

1 Answer

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.

Jan 07, 2009 | 1999 Chevrolet Malibu

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

427 people viewed this question

Ask a Question

Usually answered in minutes!

Top Sun Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18408 Answers

Cosma Papouis
Cosma Papouis

Level 3 Expert

409 Answers

Robin Hill
Robin Hill

Level 3 Expert

1263 Answers

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

Answer questions

Manuals & User Guides

Loading...