hi guys, j

how are you all doing, i havent been here for a while, anyone miss me, jus kidding anyway i am trying to build this program, it is just a practice thing but I am getting this error and havent got a clue how to make it work and why i am getting the syntax error.

int passcar = 297;
        int lighttruck = 350;
        int motorcycle = 500;
        int boat = 297;
        int numofv;
        int numofacci;
        char yes;
        char no;
        int DUI;

        double totalaccident, localdui, totalbpremium, totalinsurcost;
        String allvehicles,typeofcar,passengercar;

        System.out.println("enter the amount of number of vehicles");
        numofv = in.nextInt();

        System.out.println("enter number of accident");
        numofacci = in.nextInt();

        System.out.println("have you ever been convicted of any DUI");
        DUI = in.nextInt();

        for(int i = 0; i<numofv; i++)
            totalbpremium = 0.0;
            localdui = 0.0;
            totalinsurcost = 0.0;

            System.out.println("what type of car do you wish to acquire");
            typeofcar = in.nextLine();


the last line of the code is where I am getting the err. which is if(typeofcar.EqualsIgnoreCase.("passengercar") this is where the error is. can anyone explain it to me much thanks in return

1 Year
Discussion Span
Last Post by divinity02


that's just one of the problems.
the correct way is:


so, remove the . and change your method call: equals and equalsIgnoreCase, just like any other method start with a lower case.


hi stultuske
how re you darling, thank you ohhhh so much
thank you cgeier
system.out.println("big hug to you guys")
ah got it to remove

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.