# Can anyone read and help with a lab?

**URL:** <https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759>\
**Category:** Processing.py\
**Tags:** homework\
**Created:** [April 13, 2020, 11:26pm UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759 "2020-04-13T23:26:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rachellinden24](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@rachellinden24](https://discourse.processing.org/u/rachellinden24)\
**Post date:** [April 13, 2020, 11:26pm UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/1 "2020-04-13T23:26:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [April 13, 2020, 11:53pm UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/2 "2020-04-13T23:53:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rachellinden24](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@rachellinden24](https://discourse.processing.org/u/rachellinden24)\
**Post date:** [April 14, 2020, 12:07am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/3 "2020-04-14T00:07:21Z")

</div>

I have:  
def setup();

def draw();

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

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [April 14, 2020, 12:11am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/4 "2020-04-14T00:11:23Z")

</div>

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/setup_.html)  
[https://processing.org/reference/draw\_.html](https://processing.org/reference/draw_.html)

Also check out keyPressed():  
[https://processing.org/reference/keyPressed\_.html](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](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.

---

<div class="post-metadata">

**Author:** ![rachellinden24](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@rachellinden24](https://discourse.processing.org/u/rachellinden24)\
**Post date:** [April 14, 2020, 12:21am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/5 "2020-04-14T00:21:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [April 14, 2020, 12:49am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/6 "2020-04-14T00:49:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 18, 2020, 3:51am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759/7 "2020-04-18T03:51:32Z")

</div>

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](http://py.processing.org) reference – Python dialect, not Java.
