Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgrammingBasics;
- import java.util.Arrays;
- import java.util.Scanner;
- public class AAA {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String team=scanner.nextLine();
- String instrument=scanner.nextLine();
- double difficult=0;
- double performance=0;
- switch (team){
- case"Russia":
- switch(instrument){
- case"ribbon":
- difficult=9.10;
- performance=9.40;
- break;
- case"hoop":
- difficult=9.30;
- performance=9.80;
- break;
- case"rope":
- difficult=9.60;
- performance=9.00;
- break;
- }
- break;
- case"Bulgaria":
- switch(instrument){
- case"ribbon":
- difficult=9.60;
- performance=9.40;
- break;
- case"hoop":
- difficult=9.55;
- performance=9.75;
- break;
- case"rope":
- difficult=9.50;
- performance=9.40;
- break;}
- break;
- case"Italy":
- switch(instrument){
- case"ribbon":
- difficult=9.20;
- performance=9.50;
- break;
- case"hoop":
- difficult=9.45;
- performance=9.35;
- break;
- case"rope":
- difficult=9.70;
- performance=9.15;
- break;}
- break;
- }
- double totalResult=difficult+performance;
- double percent= ((20-totalResult)/20)*100;
- System.out.printf("The team of %s get %.3f on %s%n",team,totalResult,instrument);
- System.out.printf("%.2f",percent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement