Computer Science, asked by sangitaksingh99, 7 days ago

Wap to enter the rainfall amount in a city then display the following message...(a) if the rainfall is less than 10 then display less..(b)if the rainfall is greater than 10 and less than 20 them display normal....(c) if thr rainfall is greater than 20 then display heavy​

Answers

Answered by Anonymous
1

Answer:

class rain

{

void cal()

{

Scanner sc=new Scanner(System.in);

System.out.println("enter the rainfall amount") ;

int a=sc.nextInt();

if(a<10)

System.out.println("less" ) ;

else if(a>10&&a<20)

System.out.println("normal") ;

else if (a>20)

System.out.println("heavy) ;

}

public static void main (String [] args)

{

rain ob=new rain() ;

ob.cal();

}

}

Similar questions