
input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936

Here is a java code where we have created a function that matches your requirement.
import java.util.*;
class CreateMethod
{
public static int getResult(int rs){
double discount1=.10,discount2=.08;
double d1=discount1*rs;
double r1=rs-d1;
double d2=discount2*r1;
double r2=r1-d2;
return (int)r2;
}
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("Input Rs: ");
int rs=input.nextInt();
System.out.println(getResult(rs));
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.