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 abcdef g klmnop arstu Example 2- After pressing the 'c. 'o' and 'k' keys a few times b Cdefghij kimo O, .

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 3GZ
icon
Related questions
Question
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
aubabet
abcde fghijk I mnop arstuv w xy z
Example 2 - After pressing the 'c! 'o' and 'k' keys a few times
ab Cdef9hijki m n Op
qrst
W Xy Z
Transcribed Image 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 aubabet abcde fghijk I mnop arstuv w xy z Example 2 - After pressing the 'c! 'o' and 'k' keys a few times ab Cdef9hijki m n Op qrst W Xy Z
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage