Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ted Collins   on Dec 24 In MS Office Category.

  
Question Answered By: Anuja Shah   on Dec 24

Here is where you have to stop thinking like a human, and start  thinking
like a machine. A dumb machine that can only do what it is told.

1) You have defined starting positions.

You state that you will increment time. What are the new starting
positions for this new time increment? Perhaps the ending positions of
the previous increment? Do you define and capture velocity somewhere?

Your lecturer has perhaps done too much work for you, since you now have
to think like him, but none the less, has specified in a workbook all
the things like height, initial velocity, etc. You will need to capture
these values from the workbook into VBA variables, and work with the
variables.

Then, at the end of each calculation, write  the results back to the
workbook, each time to a new line.

So my pseudo code  looks different to yours:

'Define all variables, or check that they have been defined by the
lecturer

'1) Set starting conditions for first simulation

'2) Perform trajectory and bounce calculation

'3) Capture end position and velocity

'4) Write end values to the workbook

'5) Define new start values as old end values

'6) Loop around from 2) to 5) until distance to target has been reached.

'***********************************************************************
************
Now, what you seem to lack is an understanding of the VBA programming
language. Like most modern languages, it is object-oriented. Objects
have properties, actions, etc.

One example only is to define initial velocity.

Dim Vinit

Vinit = Sheets("Sheet1").Range("B7").value

Now you can use Vinit in a calculation. But note that the range I looked
at had a value property associated with it.

So I rephrase my first statement: Think like an object-oriented
semi-blank computer, and the logic will come.

Share: 

 
 
Didn't find what you were looking for? Find more on Pseudocode Or get search suggestion and latest updates.


Tagged: