Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Solution {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String[] str = sc.nextLine().split(" ");
- double salary = Double.parseDouble(str[0]);
- double hra = (20*salary)/100;
- double da = (50*salary)/100;
- double pf = (11*salary)/100;
- double ans = salary+hra+da-pf;
- if(str[1].equals("A")){
- ans+=1700;
- }else if(str[1].equals("B")){
- ans+=1500;
- }else{
- ans+=1300;
- }
- System.out.println(ans);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment