Need help with programming

I have just started a programming class in college and I have an assignment due tomorrw. It is seriously kicking my ass. Here are the steps we have to do (they aren't that hard, I'm just new):
Present a menu with four options
1) Enter scores
2)Display scores
3) Calculate Statistics
4)Exit
I need this to be a functional application. In the statistics I need largest and smallest numbers and the average of all of them.

bump

bumperino

Bamp

boomp

come and help me you faggots

hahaha

OH MY GOD

a) Do you know how to store input as a variable?
b) Do you know how to print a set of values?
c) Do you know how to calculate the average of N values?
d) Do you know how to make a menu, even if it's the kludgiest part of the code?

Sent ;)

e) do you know how to make the program exit?

I can make it exit and make a menu. Finally got that shit. Just not the others.

Maybe you should have stuck with that English major?

Alright, well I can't tell you what to do, but I can give ya hints.

a) How to store input in a variable is without a doubt in your notes, slides, or some chapter in the book you've already been assigned for the class.
b) Same for printing.
c) Figure out how to calculate the average of every number in an arbitrary array first. Or in the array [10,5,8,2,6,-4,3] if you want to start with something concrete. And then how to find the smallest number. And then the largest.

what language op

c#

I am pretty much fucked. If anyone could help, that would be great.

that's ez pz Pham

if the user chooses option 1, take their inputs and add them to an array

If the user chooses option 2, print that array, you will need an array to string method.

If the user chooses option 3, loop through the array adding all the numbers then dividing by the number of elements in the array

Then do another loop through the array and compare whether the first two indexes is larger or smaller, store the larger one in a variable and then compare that with the next index etc

Then do the same for smallest value and you should be good

Just sounds like you're fucked. Maybe take more notes next time

int userSelection;

while()
{
Console.WriteLine("(1)Enter Scores");
Console.WriteLine("(2)Display Scores");
Console.WriteLine("(3)Calculate Scores");
Console.WriteLine("(4)Exit");
userSelection = Convert.ToInt32(Console.ReadLine());


if(userSelection = 1)

{

}
here is what I have so far

>not posting language
>not googling
>getting stuck on the most basic of concepts

ff gg

Not too familiar with c# but It should be something like
Arraylist() inputList = new ArrayList(int32);
If( userSelection == 1)
{
Console.WriteLine("Enter Score: ")
int input =Convert.ToInt32( Console.ReadNextLine());
inputList.add(input);
}

youre a fucking life saver. Thank you.

bump

boomp

int[] numbers;
int userSelection = Convert.ToInt32(Console.ReadLine());
while(userSelection != 4)

{

Console.WriteLine("________Menu_________");
Console.WriteLine("1) Enter Scores ");
Console.WriteLine("2) Display Scores ");
Console.WriteLine("3) Calculate Statistics ");
Console.WriteLine("4) exit ");
Console.WriteLine("______________________");
Console.WriteLine("Enter your selection (1-4)");
userSelection = Convert.ToInt32(Console.ReadLine());


if (userSelection == 1)
{

Console.WriteLine("How many numbers would you like to enter?");
int userInput = Convert.ToInt32(Console.ReadLine());

}


else if (userSelection == 2)
{

Console.WriteLine("Here are your scores: " + );


}
else if (userSelection == 3)


{


}
}


}
}
}
this is what I have now

You need to initalize int[] numbers.
int[] numbers = new int[ArraySize]

Change ArraySize to a number you find fitting like 10 or however many spots you need.

// Don't be a noob

Maybe you should have tried the humanities or something

help me too

I need to make ablack jack program in python

Make your own thread faggot

no fuckyoo

Also to add numbers is something like

numbers.add(userInput)
or
numbers.add(Convert.ToInt32(Console.ReadLine());

Neither of these work. Doesnt recognize the word add or userinput

My problem now is adding the user inputs into the array

Then run it through a for loop as so

for (int i = 0; i < 10; i++) {
numbers[i] = Convert.ToInt32(Console.ReadLine();
}

There was a problem. It says the index is out of range exception

Well you need to make sure you initialized it to a big enough array.

>nt[] numbers = new int[ArraySize]
>Change ArraySize to a number you find fitting like 10 or however many spots you need.

Your for loop should not exceed the size you set. The example I gave was 10, so numbers wouldve been of size 10. You can change this size to fit to your program.

C# looks so retarded compared to C++. Why does C# exist?