Crossposted: https://community.oracle.com/thread/3617433
Type: Posts; User: PhHein
Crossposted: https://community.oracle.com/thread/3617433
You're in the main method, which has a void return type. Just replace the return by a System.out.println(....).
You have never defined output. What are you trying to display?
Hi and welcome, Ahmed.
Hi,
post your code and ask specific questions. It's hard to help you without knowing where you are stuck. Break the assignment down to small bits, start with getting the user input. Read the API...
The Really Big Index
Ayup. That's correct.
[-X
what errors are you getting? Also you might think of better method names. Also method names start with lower case letters.
No problems. And even if you were doing her assignments, she's likely to fail sooner or later. Anyway, have fun coding and feel free to ask questions.
Hi,
you declare and init those variables:
double trans = 0;
double elec = 0;
double food = 0;
But you never assign the values that your methods return, i.e. you pass three 0.0 into...
You forgot to import BufferedReader
Hi, please format your code with code tags (see my sig link).
What kind of problem do you have? Compiler or runtime errors? Unexpected output? etc.?
madgame618, thanks for helping other users,but don't post ready made code. You know, teach how to fish instead of handing out fish.
And use code tags when posting code.
Format your code with code tags and post the full error message you get.
Start writing a Car class. Compile hw1test and have a look at the comliper errors. They tell you what's missing.
Just noticed, don't
System.out.print("A. San Diego\n");
but
System.out.println("A. San Diego");
System.out.println(); // <------------- empty line aka line feed
I'd use a String for the input and use equalsIgnoreCase() to check the answer. You are using C which is an undeclared variable.
Basically it works like this:
System.out.print ("Enter your...
And obviously language. This is a forum not SMS. How many seconds did you save by not spelling properly?
Most likely you're not on the EDT when adding those items. BTW: you're just adding "supn", you should probably add name. Did you make sure you actually enter the while loop?
Hi and welcome,
that was a long read. What I understood is that you already have some dangerous half knowledge and generally keep trying things, which is not a bad thing. I believe you're making a...
Do you have a question?
If the user enters N the first part (!response.equalsIgnoreCase("Y")) is true and if the user enters Y the second part is true. If the user enters X both parts are true. Use the && operator
The...
It's really hard helping without seeing your code.
Hi,
it's often a matter of personal preferences. There are hundreds of online tutorials and as many books about Java.
I think Head first Java by Bates and Sierra is a great book for beginners....