i'm new in java and dont really know much about iterations, i tried the following:
for (int i=1; i<=7; i++) {
System.out.println("please enter day's cost")
cost = console.ConsoleIO.readInteger();
total = ?here where i have a problem, i dont know how to sum the total week's costs
> dunno, i dont think it is cause the total is unknown
> and it is what i want to get
of course the total is unknown. that's what your program does, finds it out. forget computers for a minute. how would you do this with a pen and paper? you'd start off not knowing the total, and ask questions until you had it, right? like
"what were mondays takings?" "oh, 50"
"ok,what were tuesdays?" "um, 102"
"and wednesdays?" "200"
and you'd add the latest answer to your running total. same thing here
> well, i'm using NetBeans IDE 5.5 and i think it's
> different from other java apps
ok here's what to do (and I'm deadly serious)
1) throw netbeans away for now. pretend you've never heard of it
2) get hold of a text editor like TextPad (if you're on windoze)
3) get a basic tutorial and go through it
trying to sort this out here is going to be frustrating for all concerned, and take ages. trust me
> i guess so, i'm not skilled enough and that is why i
> asked for help
yeh, and my advice is to lose netbeans. is this for college? your tutor shouldn't be setting you assignments he hasn't prepared you for, and he certainly shouldn't be ramming IDEs down your throats just yet
> no, everyone in the college uses NetBeans for such
> lessons, the tutor taught us about a part of this,
> but didnt explain the other possibilities such as
> summing such entries.
and what I've outlined above isn't of any use to you? then you really need to
1) drop netbeans - you think that's causing your problem, and it isn't, so get rid of it until you understand how it works
2) do a basic tutorial. any answer you get here will be followed by "but how do I do that?" for about 3 days, before everyone gets frustrated by constantly answering fundamental questions that won't be understood anyway, and you'll lose it and abuse somebody then get banned (happens all the time)
3) pay more attention in class. I don't believe for one second you've got this far into your course and still haven't been shown enough to understand this