Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ihave6rolls

macrumors newbie
Original poster
Sep 21, 2017
1
0
Milwaukee
Hey guys,
I am very new to programming and am taking a beginners class in college right now. I have to solve for the mean, linear regression line, and variance. I am given a txt file that has two columns. The first (x-column) is height and the second (y-column) is wingspan. Long story short, I have to write a code that has 4 seperate functions and will take the txt file. I keep getting parse issues saying expected expression. I have no idea what that means and cannot figure out my error. I have attached screenshots of my code. If someone can help me on this, that would be great.
Thanks!
 

Attachments

  • Screen Shot 2017-09-21 at 7.25.24 PM.png
    Screen Shot 2017-09-21 at 7.25.24 PM.png
    95.4 KB · Views: 253
  • Screen Shot 2017-09-21 at 7.25.38 PM.png
    Screen Shot 2017-09-21 at 7.25.38 PM.png
    138.2 KB · Views: 238
  • Screen Shot 2017-09-21 at 7.25.51 PM.png
    Screen Shot 2017-09-21 at 7.25.51 PM.png
    169.4 KB · Views: 249
Just having a quick glance over your screenshots...

If you want to pass an entire array then you don't need to put [] after its name - just use the name.
If you want to reference an individual element of an array then you use square brackets [], not round brackets ().

I think that should cover 80% of the problems.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.