Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String size = scanner.nextLine(), color = scanner.nextLine();
- int eggCount = Integer.parseInt(scanner.nextLine());
- double total =
- (size.equals("Large") ? (color.equals("Red") ? 16 : color.equals("Green") ? 12 : 9) :
- size.equals("Medium") ? (color.equals("Red") ? 13 : color.equals("Green") ? 9 : 7) :
- (color.equals("Red") ? 9 : color.equals("Green") ? 8 : 5)) * eggCount * 0.65;
- System.out.printf("%.2f leva.\n", total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement