74.7k views
3 votes
The following program is run. Then the user clicks the "bottomButton" ONCE and then clicks the "topButton" ONCE. What will be displayed in the console?

User Cerveser
by
4.3k points

1 Answer

0 votes

Answer:

"ccc bbb aaa"

Step-by-step explanation:

In the program shown in the attached picture, if the user clicks the buttons in the order mentioned then the console would display "ccc bbb aaa". This is because the way the code is written the functions that display "bbb" and "aaa" require a button press. Therefore, when the code runs it loads the button events and displays "ccc" because it is the only code that does not require an input. Then once the bottomButton is pressed it adds "bbb" because it is the code associated with that button. Lastly, the topButton is pressed once and it adds "aaa" to the console.

The following program is run. Then the user clicks the "bottomButton" ONCE-example-1
User Michael Moussa
by
4.3k points