Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Need homework help

Name: Mia 2005-11-14 20:36

ttp://mars.walagata.com/w/miachan/FutureValueApp.java Is my assignment

I have to..

3. After the code that calculates, formats, and sisplays the results for each calculation, add code that stores the formatted values as strings in the next row of the array ( you need to use the toString method of the integer class to store the years value )

How in the WORLD do I go about doing this? It's a problem form Murach Beginning Java 2 JDK 5..I've been struggling through the class as i'm really really new to programming...and I really don't get it at all..

Name: Anonymous 2005-11-14 21:36

the problem seems straightforward to me, so please clarify exactly what the problem you're having is.  you don't understand the question, you don't understand Java, you don't understand what a 'toString' is, you don't understand what 'sisplays' is?  other?

Name: Mia 2005-11-15 15:27

What I don't understand is..Like, how to make the first set of values (inv/mo) go into the first row, first column ( [0,0] ) and the other for values into each subsequent column, and switch to the next row, for up to 10 rows, each time the program runs.

Name: Anonymous 2005-11-15 17:43

>>1, >>3

Consider the zen
of the nested loop structures.
Make peace with counting.

Name: Anonymous 2005-11-15 20:21

>>3
the counter you added in step 2 should point to whatever row you want to add data to (hence rowCounter).  you should be able to do the columns with normal assignment.

Name: Anonymous 2005-11-15 20:51

What is "normal assignment" ? x.x

Basically what I want to do is..

For ( each time program runs )
initial colum initial row = inv/mo variable
row++

But how do I set the initial column initial row to that variable, and have it go right onto the next one? x.x

Name: Anonymous 2005-11-15 21:37

normal assignment just means as follows:

    variable = value;

array elements are handled exactly like variables, thus:

    array[x][y] = value;

with 'x' being the row you're on, and 'y' being the column.

thus:

    array[x][0] = inv/mo value; // row 'x', col 0
    array[x][1] = rate value;   // row 'x', col 1

and so on.

Name: Anonymous 2005-11-16 7:16

Unless you're implementing a spreadsheet you probably have no reason to be using 2 dimensional arrays.

Name: Anonymous 2005-11-16 23:37

>>8

I think multi-dimensional arrays (4+ dimensions) on the heap are great when you're pissed off at the maintenance programmers for some reason.  Everybody likes code with 3 or 4 *'s and an & thrown in for fun.

Name: Mia 2005-11-20 23:36

I need to use a 2 dimensional array as part of the assignment. My assignment was as follows..

1. Open application, add comments, etc.
2. Declare variables at the beginning of the main method for a row counter and a rectangular array of strings that provides for 10 rows and 4 columns
3.After the code that calculates, formats, and displays the resutls for each calculation, add code that stores the formatted values as strings in the next row of the array ( you need to use the toString method of the integer class to store the years value).
4. Add code to display the elements in the array at the console when the user indicates the program should end. The output should be formatted as shown above. Then, compile and test the program by making up to 10 future value calculations. When you've got this working right, close the program.


http://mars.walagata.com/w/miachan/FutureValueApp.java is my assignment. The first two steps are duh..

But the next two..

So how do I do..
--
For (each time the program runs )
initial column initial row = monthlyInvestment
row++
---

How do I increment the row? Would it be futurevalues[x++][y] ?

Somebody help it's due tomorrow!! ; - ;


Name: o_O 2005-11-28 15:16

Sounds like he's trying to get you to use enchanced For loops.
Try reading through this slide set.
(PDF WARNING!!)
http://www.cs.ucsb.edu/~mikec/cs5ja/slides/cs5wk08c.pdf

Name: Anonymous 2005-11-28 16:58

>>9
If you're in C99 (or C++ and gcc) you can access any array as a multidimensional array with some pointer casting. Not only does it confuse the compiler optimizers, it also confuses maintenance programmers.

Name: Anonymous 2009-08-16 23:19

Lain.

Name: Anonymous 2011-02-02 22:58

<

Name: Anonymous 2011-02-04 16:05

Don't change these.
Name: Email:
Entire Thread Thread List