Question
Q: Write a code in processing which does the following things. You can't import the tkinter and the fries should be drawn rather than using
Q: Write a code in processing which does the following things. You can't import the tkinter and the fries should be drawn rather than using an image.
Purpose: Practice using loops and simple information visualization For this question, you will create a Processing program that visualizes placing a simple fast food order at a drive-thru restaurant. Our restaurant in this question serves only one item: fries. Your program should allow the user to select how many fries they want and should update its canvas with pictures of the fries. Your program should have the following specifc behaviour: 1. Use a 600x300 white canvas as the backdrop 2. Initially the number of fries in the order is 0 3. Pressing the "f" key increases the number of fries in the order by 1; "n" decreases it by 1. Make sure the number of fries in the order cannot become negative. 4. At all times, the program should visually display the order, i.e. there should be 1 fries on the screen for each fries in the order. You will need to use loops to do this. 5. Start displaying the fries near the top-left corner of the canvas and fill up the canvas one row of fries at a time. If a row fills up, start displaying the items on the next row and continue doing so as needed. 6. Near the bottom of your canvas, also display a textbox stating how many fries are in the order. 7. It is okay if the order gets so big that it starts going of the bottom of the canvas; you do not need to handle this case.
Your fries dont have to look exactly the same as in the sample, but a reasonable attempt at visual appeal should be made.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started