Results 1 to 4 of 4
  1. #1
    arkkkkkkk is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default Need Help On How To Type Out Codes

    Hello.

    Currently, I am taking my first computer science course in college and I was wondering if anyone can help me out here. The assignment is to make two classes, one main and one for the methods. I need to get the max, minimum, average, mode, even, and odd numbers from a set made from a random number generator to generate samplesize integers between minvalue and maxvalue (this is what I'm having problem with the most) and store them in an array. After that, I need to return the count of the numbers in the sample set that match the input parameter (don't even know what this means) and list the variables.

    So far, this is what I have:

    Main class:

    import javax.swing.*;
    import java.util.Scanner;
    public class Prog4
    {
    public static void main(String[] args)
    {
    Scanner scan = new Scanner(System.in);
    Statistics stats = new Statistics();
    int choice;
    choice=stats.Menu();
    }
    }

    Method class:

    import java.util.*;
    public class Statistics
    {
    Scanner scan = new Scanner(System.in);
    int menu;
    public int Menu()
    {
    System.out.print("Main Menu: \n 1) Get Max Value \n 2) Get Minimum Value \n 3) Get Average value \n 4) Get the Mode \n 5) Get the Even Numbers \n 6) Get the Odd Numbers \n 7) Display Sample Set \n 8)Get the number count in the sample set \n 9) Exit");
    menu=scan.nextInt();
    return menu;
    }
    public Stats(int sampleSize, int minValue, maxValue)
    {

    }
    public int getMax()
    {

    }
    public int getMin()
    {

    }
    public double getAve()
    {

    }
    public int getMode()
    {

    }
    public int getEven()
    {

    }
    public int getOdd()
    {

    }
    public void displaySampleSet()
    {

    }
    public int countMatching(int match)
    {

    }
    private int[] data;

    }

    All I have so far is just a menu with blank methods.

    Now truthfully, I took this class because I thought making computer programs would be fun but I feel so lost and discouraged that I just want to change my major after this class. I don't feel like I'm making progress, I'm not learning much, and I feel like my professor is unfair since all he talks about is logic with gibberish codes that doesn't make clear sense and he doesn't teach us how to convert the logic into codes, which I'm having the most problem with.

    Sorry if I seem like I'm complaining and whining but I just needed someone to hear me out.

    Your help and advise would be appreciated.

    Thank you and have a good day.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    The menu method returns an int (the user's choice) back to the main method. Now you have to call another method based on the choice. User enters 1, call the getMax method. User enters 2, call the getMin method. etc

    (don't even know what this means)

    If there is something in the assignment which you do not understand, wouldn't it make more sense asking the person who set the assignment?

  3. #3
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    Quote Originally Posted by Junky View Post
    wouldn't it make more sense asking the person who set the assignment?
    and don't give me any carp about how useless your teacher is or that you can never get in touch with them or get an answer. The onus is upon you to make the effort to go and talk to them. All lecturers have consulting times.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Junky View Post
    and don't give me any carp about how useless your teacher is or that you can never get in touch with them or get an answer. The onus is upon you to make the effort to go and talk to them. All lecturers have consulting times.
    Amen! We've heard that whine too many times.

Similar Threads

  1. I need some codes
    By johnmergene in forum New To Java
    Replies: 11
    Last Post: 01-25-2011, 04:42 AM
  2. What do the following codes do?
    By javaguy2 in forum New To Java
    Replies: 2
    Last Post: 01-23-2011, 11:23 PM
  3. using instanceof to get Object type and parent type?
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 11-06-2008, 07:24 PM
  4. [SOLVED] Cast string type to int type
    By GilaMonster in forum New To Java
    Replies: 9
    Last Post: 09-17-2008, 11:43 AM
  5. Assistant on my codes. SOS!!
    By sya1912 in forum Java Applets
    Replies: 16
    Last Post: 09-01-2008, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •