can any one solve this program in scanner medhod plz
Attachments:
Answers
Answered by
1
Answer:
Explanation:
import java.util.*;
class bs
{public static void main (String args[])
{Scanner sc=new Scanner (System.in);
System.out.println("Enter the basic salary");
double a=sc.nextDouble(); double d=0,sa=0,gross;
if(a<=10000)
{d=a*15.0/100;sa=5.0/100*a;}
if(a<=20000 && a>10000)
{d=a*20.0/100;sa=8.0/100*a;}
if(a<=30000 && a>20000)
{d=a*25.0/100;sa=10.0/100*a;}
if( a>30000)
{d=a*30.0/100;sa=12.0/100*a;}
gross=a+d+sa;
System.out.println("gross salary is");
System.out.println(gross);
}}
Similar questions