0
import.java.util.Scanner; <Error This ?> [<identifier> expected]

class Work3_2
{
    public static void main(String[] args)
    {
        Scanner input=new Scanner(System.in);
        String carid;
        int park,pay;
        int parked;

        System.out.print("Enter Car ID : ");
        carid=input.next();
        System.out.print("Enter Parking Times : ");
        park=input.nextInt();

        parked=park*60;

        if(parked <=15)
            pay = 0;
            else if(parked >15 && park <=60)
                pay=20;
                else if(parked >60 && park <=120)
                    pay=40;
                    else if(parked >120 && park <= 180)
                        pay=60;
                        else
                            pay=(parked-180)*10/60;

        System.out.printf("Your car Id is : %n" + carid);
        System.out.printf("Your Pay of Parking is : " + pay);



    }
}

Why it Error. Thanks for all

Edited by Reverend Jim: Fixed formatting

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by javaAddict
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.