Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class trainersSalary {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int lections = Integer.parseInt(input.nextLine());
- double budget = Double.parseDouble(input.nextLine());
- double jelev = 0;
- double royal = 0;
- double roli = 0;
- double trofon = 0;
- double sino = 0;
- double other = 0;
- for (int i = 0; i < lections; i++) {
- String lector = input.nextLine();
- if(lector.equals("Jelev")){
- jelev+=1;
- }else if(lector.equals("RoYaL")){
- royal+=1;
- }else if(lector.equals("Roli")){
- roli+=1;
- }else if(lector.equals("Trofon")){
- trofon+=1;
- }else if(lector.equals("Sino")){
- sino+=1;
- }else{
- other+=1;
- }
- }
- double perHour = budget / lections;
- jelev*= perHour;
- royal*= perHour;
- roli*= perHour;
- trofon*= perHour;
- sino*= perHour;
- other*= perHour;
- System.out.printf("Jelev salary: %.2f lv%n",jelev);
- System.out.printf("RoYaL salary: %.2f lv%n",royal);
- System.out.printf("Roli salary: %.2f lv%n",roli);
- System.out.printf("Trofon salary: %.2f lv%n",trofon);
- System.out.printf("Sino salary: %.2f lv%n",sino);
- System.out.printf("Others salary: %.2f lv%n",other);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement