EDIT: This is only for a small assignment. My question is, how do I make it so runningtotal outputs the total instead of the price.
Here's a picture, it says the total is the inputted number when it should be an addition of all the prices that came before it.
Shaktar Donetsk wrote:No it's still not adding. I've been trying different things for hours, this is really wierd
The unary plus operator doesn't really do much with primatives, so "+price" is basically the same as "price",
is the same as ...
Or in other words, the runningtot is taking the value of price, because you are assigning the value of price to the runningtot variable.
Shaktar Donetsk wrote:I created a topic on another site. I've only tried the for loop and a lot of other smaller things like moving the location of 'double runningtot' because it wasn't declared locally or something along those lines. Just tinkering with things but no clear answer.
Yeah, "tinkering with things" with no clear direction is not very efficient. you should have at least have an idea of what you are tinkering with. I recommend taking a look at the Oracle tutorial, here is the pages for the operations and expressions.
perhaps it is a good place to start.
Shaktar Donetsk wrote:I've got a project due soon though. I knew how to do it before but its slipped my mind. I know it's something very simple, can you show me?
That wouldn't help you understand anything and after some time you will again face the same problem. Atleast go through the operator list through Henry's link and see whether there indeed is an operator like =+
That's really not relevant to us. We're happy to help, but if you make it URGENT or stressful, folks will just walk away and not bother.
Shaktar Donetsk wrote:I've got a project due soon though.
Shaktar Donetsk wrote: I knew how to do it before but its slipped my mind. I know it's something very simple, can you show me?
The link Henry provided tells you what valid operators are. look at it CAREFULLY, and see if you can find "=+" (or perhaps something that looks a lot like it).
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
ScroogeXHTML 7.2 - RTF to HTML5 / XHTML converterhttps://coderanch.com/t/692027/ScroogeXHTML-RTF-HTML-XHTML-converter