#need help with method and parameters

70 messages · Page 1 of 1 (latest)

hallow quiver
#

how would i call the method even tho the parameter is different

plucky muralBOT
#

This post has been reserved for your question.

Hey @hallow quiver! Please use /close or the Close Post button above when you're finished. 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.

strange pendant
hallow quiver
#

ok ok

#

so i want the method of calorie

#

to be called like used right its giving me an error because calorie is taken as a double

#

instead of a string

hallow quiver
#

i want the method of calorie

#

to be used

#

but it wont allow it

#

because its a double

#

anyway i can change that

strange pendant
#

what is a string?

hallow quiver
#

should i just send the rror

#

error

strange pendant
#

No, we know what's the error

#

We don't understand what's blocking you from fixing it

hallow quiver
#

the way ive been using it has been working plus im eleventh grade so they havent really taught me the way u guys would call it

strange pendant
#

So, the method requires a double

hallow quiver
#

yea

strange pendant
#

One would expect that to call it right, you need to give it a double

hallow quiver
#

it does

#

have a double

#

ye

#

alright i understand that ok let me just give u like a mini explanation on why it wasnt working for me if thats fine

#

calorie is being called here right

#

but the problem is i want the calorie method to run after asking the question on whether they want to know they're calorie deficit

#

what i intially did was

#

i have 4 other methods and what i did was ask the question after each method

#

but that didnt work out

#

so what i thought was why not make the question its own method

#

and try to make it run calorie

#

but it wouldnt work and i had no idea like what to do

#

ye

strange pendant
#

(....... Because that's what Scanner.nextDouble() does?)

hallow quiver
#

wait

strange pendant
#

..... Does it look to you like it doesn't work?

hallow quiver
#

if i do use that would i still be able to like activate the calorie method thing

strange pendant
#

I think we're derailing

hallow quiver
#

ye

strange pendant
#

That "first of all" was weird, I don't see why one would say that

#

So, you told us a story and all, but that story was fairly useless

hallow quiver
#

my fault

strange pendant
#

The method calorie requires a double so you must call it with a double

#

That is all

hallow quiver
#

i cant try and make it ask the question or anything

strange pendant
#

What question?

#

Just simply say what's your problem

hallow quiver
#

i want to use the calorie method but like how would i if im not doing something to like activate it

strange pendant
#

Ah you will have to do something like activating it, yes

#

Something like calorie(2.5), as was said

hallow quiver
#

wdym

strange pendant
#

just that. Instead of calorie(), calorie(2.5)

hallow quiver
#

yea

strange pendant
#

that's all

hallow quiver
#

is there like anyhting special with the numbers

strange pendant
#

5 is kind of rude, but 2 is a nice bloke

hallow quiver
#

theres one more thing

#

i'd like to ask

#

actually nvm so the code or the method will activate if i use the number right

strange pendant
#

sounds like it

hallow quiver
#

ok lemme test this out thx

#

i got a whole new problem now

#

😭

#

my code is supposed to run the other methods but it just skips to the calorie method

#

it doesnt even ask the question method

#

nvm fixed it thx a lot