Computer Science, asked by subhashreemohantyman, 11 months ago

Wap to input basic salary and name of an employee. Calculate the tax and gross salary. Display details of the employee with message.
Plz someone answer. I need it urgently. I've got 2 more questions. My teacher doesn't explain properly so my basics in Java Scanner class is not clear.

Answers

Answered by Anonymous
1

Answer:

import java.util.*;

class Salary

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("enter name & salary");

String n=sc.nextLine();

int s=sc.nextInt();

int t=2/100;

s=t*s;

System.out.println("name of the employee is" + n);

System.out.println("salary of the employee is" + s);

}

}

hope it helps!!!

Similar questions