Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int km = Integer.parseInt(s.nextLine());
- double taxi =0;
- double cena =0;
- String vreme=s.nextLine();
- if(vreme.equals("day")){
- taxi=0.79;
- }else if(vreme.equals("night")){
- taxi = 0.9;
- }
- if(km<20){
- cena=(taxi*km)+0.7;
- System.out.println(cena);
- }
- if(km>20 && km<100){
- cena=km*0.09;
- System.out.println(cena);
- }
- if(km>100){
- cena=km*0.06;
- System.out.println(cena);
- }
- }
Add Comment
Please, Sign In to add comment