Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String type = scanner.nextLine();
- int r = Integer.parseInt(scanner.nextLine());
- int c = Integer.parseInt(scanner.nextLine());
- double seats = r * c;
- double ticket = 0.0;
- if(type.equals("Premiere")){
- ticket = 12.00;
- }else if(type.equals("Normal")){
- ticket = 7.50;
- }else if(type.equals("Discount")){
- ticket = 5.0;
- }
- double result = seats * ticket;
- System.out.printf("%.2f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement