Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Solution {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String cid = sc.next(),cName = sc.next();
- double litres = sc.nextDouble();
- double cost=0;
- if(litres<200){
- cost = litres*3;
- }else if(litres>=200&&litres<400){
- cost = litres*3.35;
- }else if(litres>=400&&litres<600){
- cost = litres*4.80;
- }else{
- cost = litres*5.10;
- }
- if(cost>1250){
- cost+=(cost*15)/100;
- }
- System.out.println(cid);
- System.out.println(cName);
- System.out.println((long)litres);
- System.out.println((long)cost);
- }
- }
Add Comment
Please, Sign In to add comment