It is not a graded question. It is a practice question from last year. I'm stuck please help! Question You should be able to do this question after learning about how to display text and learning how to write a basic counting loop. Use a counting loop to draw the eight buttons on the top button bar. Create appropriate global constants to specify the width and height of the buttons as well as the number of buttons. This loop should draw buttons with no text labels on them. You can choose whatever fill colour you want for the buttons. Next, add the text labels [New…, Original, UPPER, lower, iNVERT, camelCase, CONSTANT] to the buttons, one at a time1. You can’t do this inside the loop because each label is unique. You can create functions to draw each button label if you want. All the labels should be vertically aligned and each label should be centered in each button. The buttons should follow the order shown. There is no label for the last button (that’s for the bonus). Finally, add code to the button loop to detect if the mouse is over the button you are currently drawing, and if so, use a different highlight colour to indicate this, as seen in the demo. All of the code for this should be in one or more functions, and only the main button bar drawing function should be called from your draw() function. At this point, your draw() function should only contain a background call and the function call to draw the button bar.
It is not a graded question. It is a practice question from last year. I'm stuck please help!
Question
You should be able to do this question after learning about how to display text and learning how
to write a basic counting loop.
Use a counting loop to draw the eight buttons on the top button bar. Create appropriate global
constants to specify the width and height of the buttons as well as the number of buttons. This
loop should draw buttons with no text labels on them. You can choose whatever fill colour you
want for the buttons.
Next, add the text labels [New…, Original, UPPER, lower, iNVERT, camelCase, CONSTANT]
to the buttons, one at a time1. You can’t do this inside the loop because each label is unique. You
can create functions to draw each button label if you want. All the labels should be vertically
aligned and each label should be centered in each button. The buttons should follow the order
shown. There is no label for the last button (that’s for the bonus).
Finally, add code to the button loop to detect if the mouse is over the button you are currently
drawing, and if so, use a different highlight colour to indicate this, as seen in the demo.
All of the code for this should be in one or more functions, and only the main button bar drawing
function should be called from your draw() function. At this point, your draw() function should
only contain a background call and the function call to draw the button bar.
Attached is the picture of my code currently.
Thanks
Step by step
Solved in 2 steps with 1 images