vendredi 17 avril 2020

How to correctly make a counter work in java

I'm a beginner student with java and this is part of an assignment I have to do for my online course using the programming language java in the NetBeans IDE.

We are required to create an application that asks the user to click on a total of twenty bananas without going over. If they do go past 20 bananas, they must start again. And the label should display the user's total banana count.

This is a finished version of the program: https://gedsb.elearningontario.ca/content/CS/1920Sem2/EL_CS_ICS3U-01_950785_1920Sem2/ICS3C%20(Java)PU02/ICS3C%20(Java)PU02A07/mme/U2A7_bananaCounterFinished/bananaCounterFinished.html?ou=14300853

I've been trying to follow the steps, but I don't really understand what I'm doing. I have some code, but I'm not sure how to code it so it declares globally and where to go from there. Here's an image of the code I have so far.

Any help would be much appreciated, thanks.

Aucun commentaire:

Enregistrer un commentaire