1 / 12

8.3 Comparison Operators

8.3 Comparison Operators. Yesterday’s Worksheet!. Calculate and display the sales tax for a purchase of $19.99 Use the tax rate in your state; for example the 6% tax rate in Pennsylvania would be calculated as 19.99 * .06 = 1.20

ralph-fox
Download Presentation

8.3 Comparison Operators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 8.3 Comparison Operators

  2. Yesterday’s Worksheet! Calculate and display the sales tax for a purchase of $19.99 Use the tax rate in your state; for example the 6% tax rate in Pennsylvania would be calculated as 19.99 * .06 = 1.20 Calculate and display the grand total of the above purchase including sales tax. Using a tax rate od 6%, this would be calculated as either 19.99 + (19.99 * .06) or as 19.99 * 1.06 = 21.19

  3. Calculate and display the 15% tip for a restaurant bill of $37.50. 37.50 * .15 = 5.63 Calculate and display the grand total for the restaurant bill above, including the tip. This can be calculated as either 37.50 + (37.50 * .15) or as 37.50 * 1.15 = 43.13

  4. Calculate and display the amount of money spent by four people who each play 11 arcade video games that cost a quarter each. 4 * 11 * .25 = 11.00 Calculate and display the number of minutes in one week. 7 (days/week) * 24 (hours/day) * 60 (minutes/hour) = 10080 minutes in a week. The first two angles of a triangle are 30º and 70º. Calculate and display the number of degrees of the third angle of the triangle 180 – (30 + 70) = 80 degrees in the third angle

  5. Calculate and display the number of cubic feet of Styrofoam noodles you would need to fill your friend’s bedroom (as a joke) if the room is 11 feet long and 13 feet wide and has an 8-foot ceiling. Use the formula for the volume of a cube: v=lwh 11 * 13 * 8 = 1144 cubic feet needed. Calculate and display the number of cubic inches of tuna in a tuna fish can that is 2 inches high and 4 inches in diameter. Use the formula for the volume of a cylinder,v=3.14 * r2*h, where r is the radius of the can (1/2 the diameter, or 2 inches) and h is the height of the can (2 inches). 3.14 * 2^2 * 2 = 25.12 cubic inches

  6. Calculate and display the number of cubic feet of water in a circular swimming pool that is 20 feet wide and 5 feet deep.Use the formula for the volume of a cylinder: v=3.14 * r2 * h. 3.14 * 102 * 5 = 1570 cubic feet of water If one cubic foot of water weighs 62 pounds, calculate the weight of the water in the pool. 1570 * 62 = 97340 lbs. Is the weight of the water in the pool. Note that both of these calculations can be done at once as3.14 * 102 * 5 * 62 = 97340 lbs Calculate and display the volume of a ball with a 6-inch radius, using the formula for the volume of a sphere:v=(12.56 * r3) / 3. 12.56 * 63 / 3 = 904.32 cubic inches

  7. First, square 17, then square 10, and add them together. 17^2 + 102 = 389 Next, take the square root of that total. 389 .5 = 19.72 Can you perform both of the last 2 calculations in one statement? (172 + 102) .5 = 19.72 This is actually using the Pythagorean Theorem to determine the length of the hypotenuse of a right triangle!

  8. Calculate and display the volume occupied by the 3-D solid. Each of the edges of the cube is 3 feet long, and the cylindrical cutout is tangent to all four sides. The volume of the solid part of the above figure can be calculated by subtracting the volume of the inner cylinder from the volume of the outer cube. The volume of the cube is calculated as the length of a side cubed (S3). The volume of the cylinder is calculated as 3.14 * (radius)2 * height. So the volume of the solid part of the figure above is calculated as: V = 33 – (3.14 * 1.52 * 3) = 5.81 cubic feet.

  9. Comparison Operators? Used to perform logical comparisons between values! For Example: MsgBox(“Is this equal to “ = “this”) ?

  10. The major comparison operators are: < (less than) > (greater than) = (equal to) <> (not equal to) <= (less than or equal to) >= (greater than or equal to)

  11. What are the results of the following comparison expressions? 1 < 2 < 3 3 > 1 > 2 ?

  12. Worksheet Time! 2nd Period we are off to the Auditorium.

More Related