import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*
<APPLET CODE="hotel1" HEIGHT =300 WIDTH=500 >
</APPLET>
*/
public class hotel1 extends Applet implements ActionListener
{
Button b2,b3,b4,b5;
TextField tf1;
Color clr;
Label l1,l2,l3;
public hotel1()
{
clr=new Color(219,240,251);
setBackground(clr);
setLayout(null);
tf1=new TextField(5);
l1=new Label("Enter Quanity");
l1.setBounds(5,10,130,30);
l2=new Label();
l2.setBounds(5,10,130,30);
l3=new Label("Amount");
l3.setBounds(100,70,180,30);
tf1.setBounds(150,10,130,20);
b2=new Button("Dosa");
b2.setBounds(80,180,70,35);
b3=new Button("Idly");
b3.setBounds(20,130,80,30);
b4=new Button("Vada");
b4.setBounds(110,130,80,30);
b5=new Button("Poori");
b5.setBounds(200,130,80,30);
add(l1);
add(tf1);
add(b2);
add(b3);
add(b4);
add(b5);
add(l2);
add(l3);
l2.setFont(new Font("",Font.BOLD,14));
l2.setForeground(Color.RED);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
float A,A1,A2,A3,A4;
int a = Integer.parseInt(tf1.getText());
if(ae.getSource()==b2)
{
A1(30*a*14) / 100)+(30*a));
System.out.println(b2+"*"+a+" = "+(A1));
}
if(ae.getSource()==b3)
{
A2(20*a*14) / 100)+(30*a));
System.out.println(b3+"*"+a+" = "+(A2));
}
if(ae.getSource()==b4)
{
A3(20*a*14) / 100)+(30*a));
System.out.println(b4+"*"+a+" = "+(A3));
}
if(ae.getSource()==b5)
{
A4(30*a*14) / 100)+(30*a));
System.out.println(b5+"*"+a+" = "+(A4));
}
}
public static void main(String[] args)
{
new hotel1();
}
}
this is my code for Hotel Management
this is not a accurate code I Still need to add billing details but 'm Nt getting the code so guys please help me
My Requirement is The Total Billing should be available neatly like Type of Item * Quantity and Total.
Thanks in Advance