• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the average and standard deviation from user input - array  RSS feed

 
Akira belliveau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have to write a program where it takes the grade a user enters from a message box and keeps continuing to ask until the user clicks cancel or OK when the text field is blank.

This is a link to the assignment if it helps http://homepages.uc.edu/~thomam/OOProg_1/assignment5.html

when the user inputs a grade the program takes that number and puts it into an array. Then it finds the average and standard deviation of all the numbers the user enters BUT it refreshes each time the user enters a new number. So each time the user enters a number the text fields refresh. I actually just finished a program similar to this but without the array. I understand how arrays work but I just don't understand how I can take that number the user enters and use it. I know that sounded confusing but I don't understand what that variable is called so I can put it into my equations. I have getters for the average and standard deviation but thats alll I pretty much have so far. This is my code so far, any tips/help?




I have a basic understanding on where everything goes but I have no idea how to use the getters I made. I just guessed because the last time I used one I just did recordPurchase(purchase); but I think this is different. I also have no idea how I can make another catch block to catch is the user enters more than 25 grades. I know this is asking a lot but I could really appreciate the help. I've been stuck on this program all day. I've searched for programs like this all over the internet but I can't find a single one that has helped me out. CAn any of you guys help me?

Thanks

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
538
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at this line:



What that would do it look for a variable named getAverage. You don't have one of those.



This would look for a method named getAverage() with no parameters. Still not what you want, but getting closer.



This would look for a method named getAverage() with one parameter of a type matching d. Can you figure out what variable you should use instead of "d"?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!