• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what is your question? Where did you stuck? What have you done so far ?
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks pretty good to me.
What I would expect to see next is something like:




 
Marshal
Posts: 8957
646
Mac OS X Spring VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79943
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79943
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic