Week 5 Exercises

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.

power_calc

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.

parallel_resistance_calculator

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s