Can anyone read and help with a lab?

Perform data analysis of numeric values enter by user via keyboard:
-use a list of stores values
-read in five single digit positive numbers from user via keyboard
-create console outputs with text labels and values
-perform the following math functions on the values:
----sum
----max
----min
----average

  • letter g to repeat the process of another set of values. anything other than g will do nothing
    -promt instructing users how to start over
    -when started over list should be cleared of values
    -no extra text

thanks!
<3R

Okay. So what code do you have so far?
Do you have a setup() function?
A draw() function? How about a keyPressed() function?

I have:
def setup();

def draw();

but am confused how too create the list of any 5 numbers between (0-9)

It’s clear from seeing that code: you do not understand how the setup() and draw() functions work.

Go and read the reference for them:
https://processing.org/reference/setup_.html
https://processing.org/reference/draw_.html

Also check out keyPressed():
https://processing.org/reference/keyPressed_.html

Try writing some real code now. You will want to define the size of the sketch in setup(). In draw(), you will need a call to background. You might also want to add a few calls to text() to display instructions and your numbers (once you define their list).

Then you can look into defining a list of numbers:
https://processing.org/reference/arrayaccess.html

Please put some effort in to understand these basics, and some more effort to write some running code. Post your attempted code for more help.

1 Like

what if I just need my answers to come out in the console and

Even with console-displayed numbers, you still need to use setup() and draw() since you will want to get user-input via the keyPressed() function.

This is listed under Processing.py, and you give def as an example. If that is the case, then you need the py.processing.org reference – Python dialect, not Java.