Help with a program

Hello Good night. I'm Beginner and I've received this program to do its due tonight and i'm still having problem doing it. Could someone help me please??

Write a program to continue accepting integer numbers while the number entered is NOT 999. The program should store each number in an array called "numbers" (no more than a 100 numbers will be used). After accepting all the numbers, the program should prompt the user for the operation to be performed.

If the user enters "+" for the operation the program should find the sum of all the numbers as the result, however, if the user enters "x" for the operation, the program should find the product of all the numbers as the result.

Afterwards, if the user entered "+" for the operation, the program should then print all the numbers previously entered followed by the operation in the following manner:

Example: The numbers entered were 3, 5, 10, 999 and the operation entered was "+" :
The sum of 3, 5 and 10 is 18.
If the user entered "x" for the operation, the program should then print the output in the following manner:

Example: The numbers entered were 3,5, 10, 999 and the operation entered was "x":
The product of 3, 5 and 10 is 18.

Finally, if the operation entered was not “+” or “x”, the program should print “You have entered an invalid operation, please run the program and try again.”


Registered users can post here. Sign in or register to post.