#Input

30 messages · Page 1 of 1 (latest)

frosty hound
#

How do I get it to accept input before printing the next line of code in the output I want it to ask What would you like to name your Bee colony?
and ask for my input and then after ask the next question help me smooth brain out : )

lone niche
#

use print instead of println before nextLine

frosty hound
#

on the first question?

#

it prints this instead

lone niche
#

seems good

#

maybe add a space though

frosty hound
#

No i want to put my input first

#

like ill put pp for example as the name

#

and then for the next question to show up

#

instead of both of them prining

#

printing*

#

and when i put my input it only stores one of them

robust sequoia
frosty hound
#

so what should i do to counter that?

#

any other method i could use

robust sequoia
#

im confused what you're needing to be honest it looks like your input/output is working fine

frosty hound
#

I want it to Print "What would you like to name your Bee colony?"

#

and then i input the name

#

once i input the name "How many Bees do you want for your " +BName+ " colony?(1-5)" would show up

#

and i would put either a number 1-5

#

and then itll store it in the

#

BName and BSize variables

robust sequoia
#

ahhh i see

#

ok so when you call nextInt to get B, you are typing the number in (lets say 1) then hitting enter. When you hit enter it create a newline character but nextInt() will not read it in... leaving it for the next method to pick up

#

so when you get inside that if statement and call nextLine()... its immediately picking up that leftover newline and carrying on to the next part

#

this is a good explanation + how you can fix it

frosty hound
#

ah alr

#

yeah im going to try now

#

thanks man