Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Project, need all the help i can get!
#18
InvictHero Wrote:I guess I need help with my distance function.. as you can see from my code, it's only calculating the distance for the first floodlight. given measurement_1(which is 25 in the data file) and measurement_2(which is 23.5 in the data file). In the data file, the last piece of data, according to the project handout, is "Distance (feet) the lights are mounted above the positions". So I'm confused as to how I code my distance(D) function.

after you declare the # of floodlights from the second digit, you have to have the floodlight data be an array of doubles(even if there is 1 floodlight e.g //double floodlightPower[numFloodlight]Wink
so when you pass in the array, your calculation array should have the ability in a forloop manner to calculate both distances by using a for loop inside of the distance function. if numFloodlight is 1, then the loop passes once. if numFloodlight is 2, then it should pass twice. i'll leave it to you to figure out how the array will find out how many times it has to loop.
Reply


Messages In This Thread
C++ Project, need all the help i can get! - by Dudewitbow - 2014-05-02, 01:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)