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.