Advertisement
psi_mmobile

Untitled

May 24th, 2022
806
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  4.         String country = scanner.next();
  5.         String discipline = scanner.next();
  6.        
  7.         double difficultyRibbon = 0.0;
  8.         double executionRibbon = 0.0;
  9.        
  10.         double diffcultyLoop = 0.0;
  11.         double executionLoop = 0.0;
  12.        
  13.         double difficultyRope = 0.0;
  14.         double executionRope = 0.0;
  15.        
  16.         switch (country) {
  17.             case "Russia" : difficultyRibbon = 9.100; executionRibbon = 9.400; diffcultyLoop= 9.300; executionLoop = 9.800; difficultyRope = 9.600; executionRope = 9.000; break;
  18.             case "Bulgaria" : difficultyRibbon = 9.600; executionRibbon = 9.400; diffcultyLoop= 9.550; executionLoop = 9.750; difficultyRope = 9.500; executionRope = 9.400; break;
  19.             default : difficultyRibbon = 9.200; executionRibbon = 9.500; diffcultyLoop= 9.450; executionLoop = 9.350; difficultyRope = 9.700; executionRope = 9.150;
  20.         }
  21.        
  22.         double totalScore = 0.0;
  23.        
  24.         switch (discipline) {
  25.             case "ribbon" : totalScore =    difficultyRibbon + executionRibbon; break;
  26.             case "loop" : totalScore = diffcultyLoop + executionLoop; break;
  27.             default : totalScore = difficultyRope + executionRope;
  28.         }
  29.        
  30.         System.out.printf("The team of %s get %.3f on %s.\n",country, totalScore , discipline);
  31.         System.out.printf("%.2f%%", (20 - totalScore) / 20 * 100);
  32.     }
  33. }
Advertisement
RAW Paste Data Copied
Advertisement