No response.
I'm currently working on a simple program that takes user input to create a gorcery list with prices and item names. It's not giving me any error codes when I run but rather nothing is appearing. I'll attach a photo below.
16 Replies
⌛
This post has been reserved for your question.
Hey @rainymc_! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
how do you want to take item if your itemNames has 0 elements so size is 0
so should i keep it at a set amount or ask the user for the amount of items beforehand and set that to the size?
u can even do while true, and if user wants to finish shopping he should write for example finish.
Would this work?
I've tried running and am now getting a seperate problem
look up how to take in a Double
it should be
scanner.nextDouble()
you're calling scanner.next()
Sorry for not updating the screenshot, I did notice that and fixed it earlier
write this code here, on chat
import java.util.Scanner;
import java.util.ArrayList;
This message has been formatted automatically. You can disable this using
/preferences
.If
Scanner#nextLine
reads an empty line after calling a different Scanner#next
method, take a look at this StackOverflow post.You'll also run into this problem
💤
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.
💤
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.