How do I do that? I don't know how to place the text file in the same directory as the java file.
Type: Posts; User: tai8
How do I do that? I don't know how to place the text file in the same directory as the java file.
Hello so for this problem i have to read a text file but for some reason it won't let me do it.
this is my code:
import java.io.BufferedReader;
import java.io.FileReader;
import...
my god i really dont know... anyone?
I tried it and still nothing. sigh... i want to die :(
I don't think changing the order does anything. I just tried and nothing. I dont know why the 3 stands are not adding together. what is wrong with the code there?
The problem is i'm not sure why the numbers for hot dog stands 1, 2, and 3 are not adding up. I know what i want to do, i just don't know how to get there.
So how would i fix it then? Do i just delete all the loops then?
Why isn't this adding up?
Ok so i finally got the program to output but the problem is the sum of the output is wrong. This is what i have:
class HotDogStand
{
private int id;
I'm having problems with this one question, i have been at it all day now and i still don't get it.
public class HotDogStand
{
private int id;
private int numSold;
private static int...
I'm using NetBeans too. How did you get that? Did you copy and pasted exactly what I posted and ran it or did you change anything to the code at all?
Oh I forgot to mention I also have this...
How do i do that?
Really? What IDE did you use and what does your output look like?
All it says is this:
run:
BUILD SUCCESSFUL (total time: 2 seconds)
What is it supposed to show?
Ok so I have a problem.
You operate several hot dog stands distributed throughout town. Define a class named HotDogStand that has a member variable for the hot dog stand's ID number and a member...
Can you please elaborate? What println statements and where should they go? Thank you.
No one knows the answer?
Hello, so I am still stumped on this 99 bottles problem. I got most of it working however there are still some issues. This is what i have so far.
public class BottleSong {
private int...
What number of bottles?
There is no error. It's just the wrong code.
Oh ok. Um I just need the output to say:
Ninety Nine bottles of beer on the wall,
Ninety Nine bottles of beer,
Take one down, pass it around,
Ninety eight bottles of beer on the wall.
...
Thank you. Better now?
That's the problem I don't know. I'm new to this forum and I'm not sure how to do it. So you just want me to quote my code I'm guessing?
Ok I tried something completely different. This is my completely different code.
public class BottleSong {
private int bottles =99;
public BottleSong(int n)
{
bottles = n;
}
I thought I already did do that. How do I create an instance of the class and call one of its methods?
So am I supposed to just add this: "System.out.println("\nTake one down, pass it around\n");" after the public static void main(String[] args) { ? I did and when I ran it it outputted Take one down,...
How do I do that? I'm sorry for asking these questions, I'm a beginner with this and really don't know...