Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Transport {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String time = scan.nextLine();
- int n = scan.nextInt();
- double price = 0;
- if (n >= 100) {
- price = n + n * 0.06;
- } else if (n <= 20 && n<=100) {
- price = n + n*0.09;
- }else if (time.equals ("day")) {
- price = n + n*0.79;
- }else if (time.equals ("night")) {
- price = n + n*0.90;
- }
- System.out.println("price= " + price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement