import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int i=sc.nextInt();
        sc.nextLine();
        String name=sc.nextLine();
        int accnumber=sc.nextInt();
        int amount=sc.nextInt();
        sc.nextLine();
        String sd=sc.nextLine(); //startdate
        String ed=sc.nextLine(); //enddate
        sd=sd.substring(6,10);
        ed=ed.substring(6,10);
        
        int num1=Integer.parseInt(sd);
        int num2=Integer.parseInt(ed);
        int diff=num2-num1;
        if(i==1){
            double interest=(amount*diff*12)/100d;
            System.out.println(interest);
        }
        else{
            double interest=(amount*diff*5)/100d;
            System.out.println(interest);
        }
       
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: