public class Project1{
public static void main(String[] args)
int noOfPhotocopy;
float totalprice;
String customer's_name;
customer's_name = JOptionPane.showInputDialog("Enter customer's name: ");
String type;
type = JOptionPane.showInputDialog("Choose type of photocopy: G/C");
if (type==G){
noOfPhotocopy = JOptionPane.showInputDialog("Enter no of photocopy: ");
if (noOfPhotocopy<10){
totalprice = noOfPhotocopy * 0.10;
JOptionPane.showMessageDialog(null, "Total price is RM" +totalprice);
} else if(noOfPhotocopy>=10) {
totalprice = noOfPhotocopy * 0.05;
JOptionPane.showMessageDialog(null, "Total price is RM" +totalprice);
}
else if (type==C){
noOfPhotocopy = JOptionPane.showInputDialog("Enter no of photocopy: ");
if (noOfPhotocopy<10){
totalprice = noOfPhotocopy * 0.20;
JOptionPane.showMessageDialog(null, "Total price is RM" +totalprice);
} else if(noOfPhotocopy>=10) {
totalprice = noOfPhotocopy * 0.10;
JOptionPane.showMessageDialog(null, "Total price is RM" +totalprice);
}
}
i have to make a project for my Programming course and my project is to help people to calculate total price of photocopying with different type of photocopy.