GST Calculation
GST Calculation
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("Enter event name");
String name=sc.nextLine();
System.out.println("Enter the cost per day");
double costPerDay=sc.nextDouble();
System.out.println("Enter the number of days");
int noOfDays=sc.nextInt();
System.out.println("Enter the type of event\n1.Exhibition\n2.Stage Event");
int type=sc.nextInt();
Event event;
if(type==1){
}
else if(type==2){
}
else{
System.out.println("Invalid input");
}
}
}
class Exhibition extends Event{
public Exhibition(String name, String type, Double costPerDay, Integer noOfDays, Integer
noOfStalls) {
super(name, type, costPerDay, noOfDays);
this.noOfStalls = noOfStalls;
}
Double d = noOfDays*costPerDay;
Double gstAm=(d/100)*gst;
return d+gstAm;
}
public StageEvent(String name, String type, Double costPerDay, Integer noOfDays, Integer
noOfSeats) {
super(name, type, costPerDay, noOfDays);
this.noOfSeats = noOfSeats;
}
Double d = noOfDays*costPerDay;
Double gstAm=(d/100)*gst;
return d+gstAm;
class Event{
String name;
String type;
Double costPerDay;
Integer noOfDays;
public Event(String name, String type, Double costPerDay, Integer noOfDays) {
super();
this.name = name;
this.type = type;
this.costPerDay = costPerDay;
this.noOfDays = noOfDays;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Double getCostPerDay() {
return costPerDay;
}
public void setCostPerDay(Double costPerDay) {
this.costPerDay = costPerDay;
}
public Integer getNoOfDays() {
return noOfDays;
}
public void setNoOfDays(Integer noOfDays) {
this.noOfDays = noOfDays;
}