User Profile

Collapse

Profile Sidebar

Collapse
kwm123
kwm123
Last Activity: Mar 23 '10, 09:24 AM
Joined: Mar 3 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • kwm123
    started a topic Best iteration method

    Best iteration method

    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.
    See more | Go to post

  • 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,
    ...
    See more | Go to post

    Leave a comment:


  • 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...
    See more | Go to post

    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}
    I iterate through each element of the array and call another method that takes in each chemical element as a parameter and calculates...
    See more | Go to post
No activity results to display
Show More
Working...