Need HELP with Program

This is a discussion on Need HELP with Program within the C Programming forums, part of the General Programming Boards category; Ok..I got my second assignment in my programming class last week and I am getting frustrated. Ive gotten as far ...

Need HELP with Program

Ok..I got my second assignment in my programming class last week and I am getting frustrated. Ive gotten as far as displaying the menu but i am stuck and have no clue what to do next. I am still very new at this and im not very good. Can anyone help? If you need to see my code i can post what i have. Thanks

The assignment is

1. create a program that displays a menu with 6 options as seen in the example below.

2. Accept numbers from the user and calculate the selected total, product, average, minimum, or maximum.

Sample Screen Interaction:
Black is the program's output. Blue is the user's input.

void findTotal( )
This function will accept numbers from the user until 0 has been entered.
When 0 has been entered, the number of values entered will be displayed followed by the sum of all the numbers entered, as seen in the above example.

void findProduct( )
This function will accept numbers from the user until 0 has been entered.
When 0 has been entered, the number of values entered will be displayed followed by the product of all the numbers entered, as seen in the above example.

void findAverage( )
This function will accept numbers from the user until 0 has been entered.
When 0 has been entered, the number of values entered will be displayed followed by the average of all the numbers entered, as seen in the above example.

void findMinimum( )
This function will accept numbers from the user until 0 has been entered.
When 0 has been entered, the number of values entered will be displayed followed by the minimum of all the numbers entered, as seen in the above example.

void findMaximum( )
This function will accept numbers from the user until 0 has been entered.
When 0 has been entered, the number of values entered will be displayed followed by the maximum of all the numbers entered, as seen in the above example.

That's the way I'd do it anyway. That's the beauty of programming...there's usually a bunch of different ways to accomplish the same task. That's just one idea that I gave you, but I can think of at least 3 other ways to do it off the top of my head.

The problem with your code is that your user input is in the form of an int, but your case statements are checking for a char. '1' is not the same as 1. Remove the single quotes and the case statements should get executed.

Well, it being your second assignment and all, I'm assuming the instructor has taught you all you need to know to complete the assignment. So, take the stuff you've learned and apply this basic theory to some workable code.

As I mentioned earlier, there's several ways to accomplish this. Take what you've learned and apply it. For instance, if you've learned if/else, but you haven't learned switch/case then forget using switch/case because it's only going to confuse you. It can be written just as well using if/else and that's probably what you've learned by your second assignment.

The actual computations and printing will happen in the individual functions (findTotal(), etc.) since the instructor told you those functions will return type void. Don't let us confuse you by giving you code that you haven't learned yet. Just take what you've learned from your instructor and run with it

Don't bump your threads. Go read the Announcements over again, if you even read them the first time. Here, I'll make it clear for you:

5. Don't bump your threads, (Bumping: posting messages on your own threads to move them up the list).

We are not your personal servents. We don't get paid for this. We do it because we enjoy it. We do not enjoy people breaking the rules, even though it happens all the time. Just because it happens, doesn't mean it's right.

While it is nice you actually used code tags, assuming someone didn't edit your post for you and add them, you should indent your code so it's actually readable.

The "void findtotal" you talk about, as listed in your homework's description, is a rough prototype of what the function should be called, and that it doesn't need to return anything.

You do know how to make functions, right? Well how about making one? In case you don't know how, just look at main, because it too is a function. So you do the same sort of thing.

You put your functions either:
a) Before main, so main can see them.
b) Or you put them after it, and prototype them.

Give it a try, pust your latest attempt, including properly indented and readable code, after you go and read the Announcements again.