Advertisement
jwrbg

adf

Mar 9th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.23 KB | None | 0 0
  1. package ProgrammingBasics;
  2.  
  3. import java.util.Arrays;
  4. import java.util.Scanner;
  5.  
  6. public class AAA {
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.         String team=scanner.nextLine();
  10.         String instrument=scanner.nextLine();
  11.         double difficult=0;
  12.         double performance=0;
  13.  
  14.         switch (team){
  15.             case"Russia":
  16.                 switch(instrument){
  17.                     case"ribbon":
  18.                         difficult=9.10;
  19.                         performance=9.40;
  20.                         break;
  21.                     case"hoop":
  22.                         difficult=9.30;
  23.                         performance=9.80;
  24.                         break;
  25.                     case"rope":
  26.                         difficult=9.60;
  27.                         performance=9.00;
  28.                         break;
  29.                 }
  30.                 break;
  31.             case"Bulgaria":
  32.                 switch(instrument){
  33.                     case"ribbon":
  34.                         difficult=9.60;
  35.                         performance=9.40;
  36.                         break;
  37.                     case"hoop":
  38.                         difficult=9.55;
  39.                         performance=9.75;
  40.                         break;
  41.                     case"rope":
  42.                         difficult=9.50;
  43.                         performance=9.40;
  44.                         break;}
  45.                 break;
  46.             case"Italy":
  47.                 switch(instrument){
  48.                     case"ribbon":
  49.                         difficult=9.20;
  50.                         performance=9.50;
  51.                         break;
  52.                     case"hoop":
  53.                         difficult=9.45;
  54.                         performance=9.35;
  55.                         break;
  56.                     case"rope":
  57.                         difficult=9.70;
  58.                         performance=9.15;
  59.                         break;}
  60.                 break;
  61.         }
  62.  
  63.         double totalResult=difficult+performance;
  64.         double percent= ((20-totalResult)/20)*100;
  65.  
  66.         System.out.printf("The team of %s get %.3f on %s%n",team,totalResult,instrument);
  67.         System.out.printf("%.2f",percent);
  68.  
  69.         }
  70.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement