Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- String country = scanner.next();
- String discipline = scanner.next();
- double difficultyRibbon = 0.0;
- double executionRibbon = 0.0;
- double diffcultyLoop = 0.0;
- double executionLoop = 0.0;
- double difficultyRope = 0.0;
- double executionRope = 0.0;
- switch (country) {
- case "Russia" : difficultyRibbon = 9.100; executionRibbon = 9.400; diffcultyLoop= 9.300; executionLoop = 9.800; difficultyRope = 9.600; executionRope = 9.000; break;
- case "Bulgaria" : difficultyRibbon = 9.600; executionRibbon = 9.400; diffcultyLoop= 9.550; executionLoop = 9.750; difficultyRope = 9.500; executionRope = 9.400; break;
- default : difficultyRibbon = 9.200; executionRibbon = 9.500; diffcultyLoop= 9.450; executionLoop = 9.350; difficultyRope = 9.700; executionRope = 9.150;
- }
- double totalScore = 0.0;
- switch (discipline) {
- case "ribbon" : totalScore = difficultyRibbon + executionRibbon; break;
- case "loop" : totalScore = diffcultyLoop + executionLoop; break;
- default : totalScore = difficultyRope + executionRope;
- }
- System.out.printf("The team of %s get %.3f on %s.\n",country, totalScore , discipline);
- System.out.printf("%.2f%%", (20 - totalScore) / 20 * 100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement