Ajp Project
Ajp Project
PUNE
ANEEXURE II
A:…………………………………………………………………………………………………………….
B:…………………………………………………………………………………………………………….
C:…………………………………………………………………………………………………………….
D:…………………………………………………………………………………………………………….
Roll No. Student Name Marks out of 6 for Marks out of 4for Total out
performance in performance in of 10
group activity oral/ presentation
(D5 Col.8) (D5 Col.9)
It allows users to view current and historical information about their energy
and utility consumption, compare payment plans, and see trends over different
periods.
• Advantages :
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public EnergyBillingSystem() {
setTitle("Energy Billing System");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(300, 200);
setLayout(new GridLayout(5, 2));
calculateButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
calculateTotalBill();
}
});
add(nameLabel);
add(nameField);
add(unitsLabel);
add(unitsField);
add(new JLabel());
add(calculateButton);
add(new JLabel());
add(new JLabel());
setVisible(true);
}
// Calculate the total bill (you can define your own calculation
logic here)
double totalBill = units * 0.10; // Assuming a rate of $0.10 per unit
outputWindow.setVisible(true);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Invalid Input", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
• Output
• Conclusion