hello i would like someone to help me on my java code
#java code help
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @ornate fiber! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
<@&653701560609669160>
<@&1003634651061026846>
<@&653644005149638688>
<@&928038612426182677>
Why are you pinging staff unnecessarily?
hello
i don't know how to use the java help thingy
i am sorry for the pin
#❗︱how-to-get-help
see
You just have to wait till somene see it
i am sorry
how dose the roles work in this sever?
and there isn't a channel where i can post my questions
and do at helpers
Read #rules
kk
#❗︱how-to-get-help
yeah ik
You create a post and then wait till someone answers
when i posted it i did not see any memebers
when i pined people showed up
i see purple and blue roles
Your post will be visible to others , and when they can help they will join the post
ohh
do you know java?
Yeah , I'm familiar with the basics
you can see my questions correct that i posted ?
Yes
The how-to-get-help page suggested, however, to post your code as text rather than screenshots.
While we can indeed see your screenshots, what do you think is the likelihood that any of us will want to reassemble your silly puzzle and decipher an image, when you could instead have been smart and simply given us the code to check directly?
private int remainingTrips;
private String location;
public Van() {
// Constructor implementation goes here
}
public void drive() {
System.out.print("Remaining Trips before empty tank: " + remainingTrips);
if (remainingTrips >= 4) {
System.out.print(" - Full Tank ");
location = "garage";
} else if (remainingTrips > 0) {
System.out.print("\nLocation: " + location);
if (location.equals("terminal")) {
remainingTrips--;
location = "garage";
} else if (location.equals("garage")) {
remainingTrips--;
location = "terminal";
}
} else {
System.out.print(" - Empty Tank");
location = "gas station";
remainingTrips = 4;
}
System.out.println();
}
public static void main(String[] args) {
Van trip = new Van();
// Simulating trips per day, including trips to the gas station
for (int i = 0; i < 10; i++) {
trip.drive();
}
}
}
```java
@heady gyro
Excellent. Next great thing to do would be to tell what is it you have an issue with
I would normally expect someone who intends to program a computer, not to need to be told something like that
wait
let me show you something
please tell me that you are here
i am getting this errors
can you tell me what mistake i am doing
because i am doing nothing but staring at this
for ever
So far you're doing the mistake of showing jigsaw screenshots to someone who already made you the favor of explaining that it isn't smart
I'm guessing they don't talk about copy/paste anymore to future programmers nowadays
this is it
the output is what i did on the code
and where it said expected meaning what the actual code wants and is
the final code
the copy and paste dose not work
it is giving me the red circle
with the slash
Remaining Trips before empty tank: 0 - Empty Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
Remaining Trips before empty tank: 4 - Full Tank
yeah that
No idea what you're talking about
Then use words for now
You know, if you can't explain your simple situations to human experts, you'll have serious trouble explaining what you want to a computer before AIs make yet more significant progress
this is the picture i posted
please
look
me can't copy and paste it
due to discord
I look at it and I can paste the same. I doubt that it would be taken as spam
Anyway, the code you gave does not produce this result. It produces the one I posted above
i can send you what i see
I suppose, but we still have the problem that the code you gave does not produce what you say
With how many pages above?
There might be an issue copying from a website then. Didn't think about that. Could first paste in a text editor then back here
ok
Could also paste it as code, would probably get rid of the problem
i sent the picture of the code
You seem to have trouble understanding simple things. Is it on purpose?
bro it won't let me copy and paste my code
Not even as code?
i can only send you the pictucre or hop on call
no
Can you describe what you tried, with words?
well theres 2 sides ok on the left side where it said unused is my word bank code
and the the white codes is my code word bank word
that goes on the left of the code
and check it if it works or not
public class Van {
private int remainingTrips;
private String location;
public Van() {
// Constructor implementation goes here
}
public void drive() {
System.out.print("Remaining Trips before empty tank: " + remainingTrips);
if (remainingTrips >= 4) {
System.out.print(" - Full Tank ");
location = "garage";
} else if (remainingTrips > 0) {
System.out.print("\nLocation: " + location);
if (location.equals("terminal")) {
remainingTrips--;
location = "garage";
} else if (location.equals("garage")) {
remainingTrips--;
location = "terminal";
}
} else {
System.out.print(" - Empty Tank");
location = "gas station";
remainingTrips = 4;
}
System.out.println();
}
public static void main(String[] args) {
Van trip = new Van();
// Simulating trips per day, including trips to the gas station
for (int i = 0; i < 10; i++) {
trip.drive();
}
}
}
Works perfectly, and you did it before
yes thats the code
but some line codes i am having errors
on
Which ones
What do you mean you're having errors?
What do you mean you're having errors?
its not coming out right
the closest i got
So all these circles you drew before, they were useless? You did them just to flood?
the circles that i circled are the word bank codes i tried to tell you
"word bank codes"
yeah
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.