Skip to content

Instantly share code, notes, and snippets.

@ishanbhavsar3
Created January 30, 2022 03:25
Show Gist options
  • Save ishanbhavsar3/0e6dec4c5eeb2644af6acc2822c96c22 to your computer and use it in GitHub Desktop.
Save ishanbhavsar3/0e6dec4c5eeb2644af6acc2822c96c22 to your computer and use it in GitHub Desktop.
GST Calculator ( Intrastate / Interstate ), depends on GST.java
import javax.swing.*;
public class Shop {
JFrame f;
void ShopSrc() {
GST call = new GST();
f = new JFrame();
String n1 = JOptionPane.showInputDialog(f, "Enter price of product.");
double pr = Double.parseDouble(n1);
String n2 = JOptionPane.showInputDialog(f, "Enter quantity of product.");
double qt = Double.parseDouble(n2);
double tc = pr * qt;
String n3 = JOptionPane.showInputDialog(f, "Input a for intra - state and b for inter state transaction.");
char op = n3.charAt(0);
if (n3.charAt(0) == 'a') {
String n4 = JOptionPane.showInputDialog(f, "Please input SGST rate in numbers.");
double a = Double.parseDouble(n4);
JOptionPane.showMessageDialog(f, "Price of Product = Rs." + pr + "\nQuantity of Product = " + qt + "\nCost before GST addition = Rs." + tc);
call.main(tc, op, a);
} else if (n3.charAt(0) == 'b') {
String n5 = JOptionPane.showInputDialog(f, "Please input IGST rate in numbers.");
double b = Double.parseDouble(n5);
JOptionPane.showMessageDialog(f, "Price of Product = Rs." + pr + "\nQuantity of Product = " + qt + "\nCost before GST addition = Rs." + tc);
call.main(tc, op, b);
} else {
JOptionPane.showMessageDialog(f, "Input proper GST rate in numbers only!");
}
}
public static void main(String[] args) {
Shop obj = new Shop();
obj.ShopSrc();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment