StringList inventory; PFont font; String Basic = ""; int valueLocation = 0; int verticalSpacing = 60; void setup(){ inventory = new StringList (); background (255); size (800,600); font = createFont ("Arial",32,true); textFont(font,20); fill(0); text ("Volume and Surface Area Calculator",10,30); text ("Enter the Length, Width and Height of a box and press enter",10,50); text ("Length:",10,100); text ("Width:",10,120); text ("Height:",10,140); } void draw() { } void keyPressed (){ Basic += key; text (Basic,10,70); if (key == ENTER){ if (valueLocation == 3){ valueLocation = 3; } noStroke(); fill(255); rect (0,40,800,40); fill(0); text ("Volume and Surface Area Calculator",10,30); text ("Enter the Length, Width and Height of a box and press enter",10,50); inventory.set (valueLocation,Basic); valueLocation =(valueLocation+1); println (inventory); inventory.set(valueLocation,Basic); verticalSpacing = (verticalSpacing + 20); fill(0); text (Basic,150,20+verticalSpacing); Basic = ""; if (valueLocation == 3){ valueLocation = 3; text ("Using these dimensions",10, 200); int length =parseInt(inventory.get(0).trim()); int width =parseInt(inventory.get(1).trim()); int height = parseInt (inventory.get (2).trim()); int volume = length * height * width; text ("The volume of the box is:",10,240); text (volume,10,260); int surfaceArea = 2*length*height + 2*length*width + 2*height*width; text ("The total surface area of the box is:",10,300); text (surfaceArea,10,320); } } }