I have a minimum value, a maximum value and an increment index and I need to iterate between the minimum and maximum value by setting a variable 'val' to the minimum and then incrementing 'val' by adding increment index value to it till the maximum value is reached and then terminating it.
I tried it initially with a for-loop but I am really ignorant at the moment on how best to do it.
User Profile
Collapse
-
I think using class is an elegant solution for object oriented approach of calculating multiple values and code reuse. But how about storing those values together for not one but multiple calculations.
For Example, I have a method exposed by a class that takes in the element name and the temperature and calculates multiple temperature dependent properties. For example, when I call a function exposed by a class,Code:GetDerivedProperties(Titanium,
-
Hi tlhintoq , Thanks for your response. I indeed call the calculate method exposed from another class as you have suggested but the thing is I need to store all the values together in a datastructure such as an array or a list as my further calculations require operations such as comparision and other mathematical interactions of related values of different chemical elements´.
So any more suggestions and advices for storing together...Leave a comment:
-
Advice on Data structure for storing mixed type elements
I am a newbie in programming and I need some advice on storing of multiple types of data together.
My method takes in a String Array as parameter. This string array basically is an array of Chemical elements.
Code:String[] elements = { Calcium, Potassium, Magnesium, Sodium}
No activity results to display
Show More
Leave a comment: