#java code help

1 messages · Page 1 of 1 (latest)

ornate fiber
#

hello i would like someone to help me on my java code

gaunt wyvernBOT
#

This post has been reserved for your question.

Hey @ornate fiber! Please use /close or the Close Post button 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.

ornate fiber
#

<@&653701560609669160>

#

<@&1003634651061026846>

#

<@&653644005149638688>

#

<@&928038612426182677>

gleaming forum
#

Why are you pinging staff unnecessarily?

ornate fiber
#

hello

ornate fiber
#

i am sorry for the pin

gleaming forum
#

#❗︱how-to-get-help

ornate fiber
#

and i wanted help on my java code

#

i posted

#

the question tho

gleaming forum
#

You just have to wait till somene see it

ornate fiber
#

how dose the roles work in this sever?

#

and there isn't a channel where i can post my questions

#

and do at helpers

gleaming forum
ornate fiber
gleaming forum
ornate fiber
gleaming forum
#

You create a post and then wait till someone answers

ornate fiber
#

when i pined people showed up

#

i see purple and blue roles

gleaming forum
#

Your post will be visible to others , and when they can help they will join the post

ornate fiber
#

ohh

gleaming forum
#

Yeah , I'm familiar with the basics

ornate fiber
gleaming forum
#

Yes

ornate fiber
#

oki

heady gyro
#

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?

ornate fiber
# heady gyro The how-to-get-help page suggested, however, to post your code as text rather th...
    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
ornate fiber
#

@heady gyro

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

ornate fiber
#

let me show you something

#

please tell me that you are here

ornate fiber
ornate fiber
#

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

heady gyro
#

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

ornate fiber
# ornate fiber

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

ornate fiber
#

it is giving me the red circle

#

with the slash

heady gyro
#

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

ornate fiber
#

yeah that

heady gyro
#

No idea what you're talking about

ornate fiber
#

no

#

its not that

#

it won't let me write it

heady gyro
#

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

ornate fiber
#

because when i paste it is saying that i am spaming

#

with the red ion

ornate fiber
#

please

#

look

#

me can't copy and paste it

#

due to discord

heady gyro
#

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

ornate fiber
heady gyro
#

I suppose, but we still have the problem that the code you gave does not produce what you say

ornate fiber
heady gyro
#

With how many pages above?

ornate fiber
#

its not alot

#

yeah its not working

heady gyro
#

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

heady gyro
#

Could also paste it as code, would probably get rid of the problem

ornate fiber
heady gyro
#

You seem to have trouble understanding simple things. Is it on purpose?

ornate fiber
heady gyro
#

Not even as code?

ornate fiber
#

i can only send you the pictucre or hop on call

ornate fiber
heady gyro
#

Can you describe what you tried, with words?

ornate fiber
# ornate fiber

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

heady gyro
#
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

ornate fiber
#

but some line codes i am having errors

#

on

heady gyro
#

Which ones

ornate fiber
heady gyro
#

What do you mean you're having errors?

ornate fiber
heady gyro
#

What do you mean you're having errors?

ornate fiber
#

its not coming out right

#

the closest i got

heady gyro
#

So all these circles you drew before, they were useless? You did them just to flood?

ornate fiber
heady gyro
#

"word bank codes"

ornate fiber
#

yeah

gaunt wyvernBOT
#

💤 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.

ornate fiber
#

..

#

my question was not answered still