Wednesday, 1 April 2015

Exercise-6 : Write a Java Program to Solve/Calculate of a Simple Interest by given condition. Use Method to solve this issue. Do not use parameter and return value from Method.

import java.util.Scanner;
class benifit{

    int hi ,to,yr,ir;
   
    void display()
    {
    System.out.println("These result :"+((to*yr*ir)/100));
    }
}

public class Ex2 {   
    public static void main(String[] args) {
        benifit hh = new benifit();
        Scanner input = new Scanner(System.in);
        System.out.println("Plz enter your required code");
        hh.to = input.nextInt();
        hh.yr = input.nextInt();
        hh.ir = input.nextInt();
        hh.display();
    }
   
}

No comments:

Post a Comment