/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package girmmaproject;

import java.util.Scanner;
import javax.swing.JOptionPane;

/**
 *
 * @author MA
 */
public class Q8 {

    public static void main(String []a){

        Scanner input=new Scanner(System.in);
        System.out.println("Select 1 for dialog and 2 for consol application: ");
        int n=input.nextInt();

        if(n==1){
            float interest,balance,annualInterset;
            balance=Float.parseFloat(JOptionPane.showInputDialog("Enter balance."));
            annualInterset=Float.parseFloat(JOptionPane.showInputDialog("Enter annual interset rate."));
            interest=balance*(annualInterset/1200);
            JOptionPane.showMessageDialog(null, "The interset is: "+interest);
        }
        if(n==2){
            float interest,balance,annualInterset;
            System.out.println("Enter balance.");
            balance=input.nextFloat();
            System.out.println("Enter annual interset rate.");
            annualInterset=input.nextFloat();
            interest=balance*(annualInterset/1200);
            System.out.println("The interset is: "+interest);
        }
    }
}
