This assignment makes no sense. This program does less than you can do with a calculator.
Are you sure you understood what the program is supposed to do?
Type: Posts; User: Norm
This assignment makes no sense. This program does less than you can do with a calculator.
Are you sure you understood what the program is supposed to do?
There is only one assignment statement that needs to be in the program: the one that sets the value of x. The rest of the assignment statements(there are about 12 of them) do nothing useful and can...
How are you trying to print it? System.out.println("x=" + x);
Please post the code with the problem.
You only need to assign the value to x. The rest of the code doesn't do anything.
What more do you need besides the value of x?
Check you algebra. The formula for calculating x doesn't look...
Its the bold statement in post#10
I gave you the whole thing in my last post.
I did not check your algebra, but it does not look like the right formula.
Type it into the program just as you wrote it with the correction:
double x = 5000 - 23/3.0;
You have shown that you know how to enter an assignment statement here:
double day3 = 3 *(2 + (x +...
That looks like a very simple statement to enter in a program. Have you tried it?
One problem will be with integer division: 23/3 = 7 no decimal places. 23/3.0 will give decimal plaxes
What do statement? That was a typo. corrected now
If you have the formula to compute the value of x, have you tried coding it, compiling it and executing it? What happens?
The variable totalkm will only have the value from the last assignment statement. The values stored into it by the other assignment statements will be gone.
To assign a value to the variable: x...
What do you have so far? Please post the code and ask specific question about the problems you are having.