Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package LogicTwo;
- import java.util.Scanner;
- public class Cinema {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String project = String.valueOf(scan.nextLine());
- int rows = Integer.valueOf(scan.nextLine());
- int col = Integer.valueOf(scan.nextLine());
- int tickets = rows * col;//Не е нужно да е double
- double total = 0;
- switch (project){
- case "Premiere"://трябва да е с главна буква както е във входа
- total = tickets * 12;
- break;
- case "Normal"://входа е "Normal" ,а ти проверяваш за "normal"
- total = tickets * 7.50;
- break;
- case "Discount"://входа е "Discount" ,а ти проверяваш за "discount"
- total = tickets * 5.00;
- }
- System.out.printf("%.2f leva", total);//може и на един ред
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment