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 mnopqrst Example 2 - After pressing the 'c'o' and 'k' keys a few times a b c d e f g h i j k l m n Op q r s vwx v w x y z

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
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
alphabet
abcdefgh
I m n o p q r s t u v w x y z
Example 2-After pressing the 'c' 'o' and 'k' keys a few times
a b c d e f g h i j kim Op
mn
W X
yz
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 alphabet abcdefgh I m n o p q r s t u v w x y z Example 2-After pressing the 'c' 'o' and 'k' keys a few times a b c d e f g h i j kim Op mn W X yz
Expert Solution
steps

Step by step

Solved in 4 steps with 3 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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education