Name: ___________________________________ SET 3 ALL Due Monday Dec. 6th

Program 1 - "Let's Change the Slope"

  1. Write a function that draws a right triangle using the Cartesian Plane Code where:

2. Write a function that draws a triangle using the Cartesian Plane Code where:

  1. Use your functions from program set 1 that finds the slope given two points to calculate the slope for each of the 6 sides of the triangles in the example from "Lets Change the Slope" WS.
  1. Raise hand to get this checked: ________
  2. Complete what you learned from your answers above:

(Hint: Review translations from last 6 weeks which will be on the semester test.)

 

  1. Add this program and code to your web page for semester test portfolio (Set 4).

Bonus: Repeat the above but reverse the use of the X-axis and Y-axis.

 

Program 2 - Slope Functions

1. "Linear Equations" Special Cases U8L3 and U8L4

  1. Write a function that calculates the Y-intercept given the slope and 1 point.
  2. Hint: Look at the pattern of examples in finding the solutions to the linear equation worksheet to develop the function.

  3. Write a function that calculates the slope of a line given two points.
  4. Write a function that calculates the Y-intercept of a line given 2 points.
  5. Hint: Reuse your slope function and Y-intercept functions

  6. Use the data from the lines you drew in DrScheme for your test data in the above 3 functions.
  7. Raise hand to get this checked: ____________

Bonus:

Draw the Five Lane Highway, Horizontal Hold, Tee Pee and Windmill from Lesson 4 in the 4-quadrant DrScheme Plane.

 

Program 3 - U8L4 - Saving Money

  1. Write a function that calculates the amount of money you will have after t weeks. The function consumes the amount saved each week and the time in weeks that you save. Use the data in U8L4 "Birthday Gift" for your data.
  2. Write a function that determines if you will have enough money saved to purchase something given the cost of the items, the weekly savings and the time in weeks. This function should use the above function. A negative answer means you do not have enough money and shows the amount short. A positive amount shows that you have enough money and how much extra. Use the data in "Birthday Gift" as your test data. Add data that reflects something you want to purchase. Document this. Show a positive and negative value.

Program 4 - Unit 8 - Cost with sales tax

  1. Write a program for each of the 3 options for problem #28 on page 129 of your textbook.
  2. Write a function to calculate sales tax at 8.25% of the total cost.
  3. Write a function that adds the cost and the sales tax reusing each of the above functions.

Program 5 - Exercise 2.3.1.

Utopia's tax accountants always use programs that compute income taxes even though the tax rate is a solid, never changing 15%.

Program 6 - Exercise 2.3.2.

The local supermarket needs a program that can compute the value of a bag of coins. Define the program sum-coins. It consumes four numbers: the number of pennies, nickels, dimes, and quarters in the bag; it produces the amount of money in the bag.

Program 7 - Exercise 2.3.3.

An old-style movie theater has a simple profit function. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the function total-profit. It consumes the number of attendees (of a show) and produces how much income the attendees produce.