Write a complete interactive program that displays the alphabet on the canvas. • Each time the user presses a letter key, the matching letter should get a little big bigger. • When the user presses...


Write a complete interactive program that displays the alphabet on the canvas.<br>• Each time the user presses a letter key, the matching letter should get a little big bigger.<br>• When the user presses the ENTER or RETURN keys (you can use Processing's RETURN and<br>ENTER values to detect this), the letters should be reset to their initial size<br>Make sure your program doesn't crash if a non-letter key, like a number or punctuation, is pressed.<br>Hint: You might be tempted to do this

Extracted text: Write a complete interactive program that displays the alphabet on the canvas. • Each time the user presses a letter key, the matching letter should get a little big bigger. • When the user presses the ENTER or RETURN keys (you can use Processing's RETURN and ENTER values to detect this), the letters should be reset to their initial size Make sure your program doesn't crash if a non-letter key, like a number or punctuation, is pressed. Hint: You might be tempted to do this "the long way", with 26 different variables and 26 if/elif statements under your keyPressed() function. Don't do that. Use a dictionary to store the count/size of each letter. If you do this nicely, your code will be short. Our solution is only 29 lines (including blank lines and function headers!). Example 1: Initial state abcde f ghij kImno parstuvw xy z Example 2 - After pressing the 'c o' and 'k' keys a few times ab Cdefghijkim n O, qrst W X y Z

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here