Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_06_March_2016 - created by borkins on 2017-05-14.
- */
- import java.util.Scanner;
- public class _02_TransportPrice
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- boolean isDay = (console.nextLine().toLowerCase().equals("day"));
- double price;
- if (n < 20)
- {
- if (isDay) price = n * 0.79f + 0.70f;
- else price = n * 0.90f + 0.70f;
- }
- else if (n < 100) price = n * 0.09f;
- else price = n * 0.06f;
- System.out.printf("%.02f%n", price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment