• Post Reply Bookmark Topic Watch Topic
  • New Topic

Methods and Arrays with file input- I'm so lost!  RSS feed

 
T Johnson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, so this is the last assignment for my class and I'm so completly lost it's not even funny.

I've tried looking up youtube videos and reading from the book but I just don't understand what I'm doing.

So basically he gave us a half written program and he's asking us for the following:

getArrayFile, getArrayMean, getArrayStdDev, assignGrade, getArrayGrades, getMaxScore, getMinScore, and lastly DisplayGrades...



txt file contains:



Program is as followed


any helps or suggestions would be greatly appreciated.
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is your question? Where did you stuck? What have you done so far ?
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks pretty good to me.
What I would expect to see next is something like:




 
Liutauras Vilda
Sheriff
Posts: 4923
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
T Johnson,

Just so you know, your code indentation is quite poor: lots of missing curly braces, formatting also inconsistent.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would also say your main method is much too long. It should look something like this:-Actually you should have an entire class which looks like that. You can consider creating two GradeScore instances (particularly if you have two files) and you may need to put the method calls in a different order. And you will need to do something more with the print calls.

Now you should find that corresponds to the grades scores class so you can call all the methods in turn.

And welcome to the Ranch
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to count command‑line arguments then this is the correct usage:-Since you are supposed to be writing object‑oriented programming, expunge the word static from your vocabulary (except for the main method).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!