This week was focused on working with variables… The process allows the programmer to create their own variables and variable names. Variables may be created for a single sprite or all of the sprites. (very handy!)
The two problems I chose to tackle were Chapter 5, Problems 7 & 10.
Problem 7: write a program that reads I (current in Amps) and R (resistance in Ohms) and calculates P (power in Watts) using the power formula P=I²R. The result is shown in this image. I added a visual output as well as numeric. I also made input sliders to allow the user to see the relationship between terms.
Figure 1: Click the image to go to the program
Problem 10: write a program that reads the values of three resistors in parallel and calculate the equivalent resistance. The resultant program is shown in the image below.
Figure 2: Click the image to go to the program
This program asks for each resistor value and computes the equivalent resistance Rt. Included is a graphic describing what is actually being computed.