Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Please Help me o make my Project Accurate

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    9
    My Mood
    Fine
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please Help me o make my Project Accurate

    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


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    609
    My Mood
    Sleepy
    Thanks
    10
    Thanked 93 Times in 86 Posts

    Default Re: Please Help me o make my Project Accurate


  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Please Help me o make my Project Accurate

    Welcome to the forum!

Similar Threads

  1. How do i make
    By coderxx0 in forum Java Theory & Questions
    Replies: 15
    Last Post: February 18th, 2013, 07:41 PM
  2. How can I make a JDialog to make main Frame to "sleep"
    By piulitza in forum AWT / Java Swing
    Replies: 1
    Last Post: May 11th, 2012, 08:00 AM
  3. How to make it???
    By Subhasis Banerjee in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: October 29th, 2009, 02:49 PM
  4. Best beginners project in Java
    By Fendaril in forum Java Theory & Questions
    Replies: 3
    Last Post: February 10th, 2009, 08:52 AM