need help in iteration problem

i have a question that requires to use iteration ("for" repetition ) and it inquires to enter each day's cost for a whole week and then calculate and display the total week's cost.can anyone help me with this? cause i've tried everything i know.
[262 byte] By [fizzila] at [2007-11-27 1:37:41]
# 1
show us this "everything I know" stuff.....
georgemca at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 2

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

fizzila at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 3
total = total + cost, perhaps?to be honest, if you're still at this stage, you're much better off using tutorials than asking here for help. you'll take ages to get anywhere until you grasp the basics
georgemca at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 4
dunno, i dont think it is cause the total is unknown and it is what i want to get
fizzila at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 5

> 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

georgemca at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 6
well, i'm using NetBeans IDE 5.5 and i think it's different from other java apps
fizzila at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 7

> 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

georgemca at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 8
too bad, that's what i can't do, since my assignment requires using this app
fizzila at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 9
In this case I'm positive it's not the IDE's fault, but rather the aptitude of the developer.
warnerjaa at 2007-7-12 0:48:37 > top of Java-index,Java Essentials,Java Programming...
# 10
> ****, that's what i can't do, since my assignment> requires using this appyour tutor set you an assignment and told you to use netbeans, even though you barely know anything? tell him he's a *****, and a disgrace to his profession, from me
georgemca at 2007-7-12 0:48:38 > top of Java-index,Java Essentials,Java Programming...
# 11
i guess so, i'm not skilled enough and that is why i asked for help
fizzila at 2007-7-12 0:48:38 > top of Java-index,Java Essentials,Java Programming...
# 12

> 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

georgemca at 2007-7-12 0:48:38 > top of Java-index,Java Essentials,Java Programming...
# 13
this assignment is for everyone in my class and i dont know if they could do it, but i really need help in the last step that sums the total week's costs
fizzila at 2007-7-12 0:48:38 > top of Java-index,Java Essentials,Java Programming...
# 14
> this assignment is for everyone in my class and i> dont know if they could do it, but i really need help> in the last step that sums the total week's costsand your tutor specifically told you you had to use netbeans for it?
georgemca at 2007-7-12 0:48:38 > top of Java-index,Java Essentials,Java Programming...
# 15
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.
fizzila at 2007-7-21 20:10:39 > top of Java-index,Java Essentials,Java Programming...
# 16

> 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

georgemca at 2007-7-21 20:10:39 > top of Java-index,Java Essentials,Java Programming...
# 17
actually, we only had 1 period in explaining this lesson, so it wasnt really enough to understand everything, and i hope someone else can help me with this problem.thanks anyway
fizzila at 2007-7-21 20:10:39 > top of Java-index,Java Essentials,Java Programming...