Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

American Public University System Functions in Python Project

American Public University System Functions in Python Project

American Public University System Functions in Python Project

Description

Preparation

Download and run the program Download PracticeFunctions.py.Look at what it does and look at the code to get an idea of the program structure.

Directions

The programming assignment for this unit has two functions. Use these two functions as models for the functions you are to write.
You will be removing code from main() and putting it in several separate functions. The behavior of the program will not change throughout the exercise, so you can always tell if your program is correct. As you copy code from the main to a function, you will have to change the name of variables to match the names of the function parameters.

  1. Use the non-fruitful function drawRect as a model. Write another non-fruitful function that draws a filled circle. The function is defined as
    def drawFilledCircle(t, rad):
        """ Draws a filled circle of radius rad using turtle t """

    and called with a statement like

    drawFilledCircle(alex, radius)

    The contents of the function are to begin filling, draw a circle, end filling.Make sure you call your function in two different places in the program, using a different parameter each time.

  2. Write another non-fruitful function drawEquilateralTriangle , which is defined as
    def drawEquilateralTriangle(t, side):
        """ Draws an equilateral triangle using turtle t with sides of length side """
    

    and is called with

    drawEquilateralTriangle(alex, tri_side)

    Make sure to use the parameters side in the body of this function. Make sure you call your function in two different places in the program, using a different parameter each time.

  3. Next, you’ll work with fruitful functions. Look at the function to calculate the next y-position for drawing a set of shapes. This function is called near the bottom of the program:
    ypos = next_y_position(ypos, width)

    Using this function as a model, add a fruitful function to calculate the length of a side of an equilateral triangle with a given area, which is math.sqrt(length*width*4/math.sqrt(3)). The function is defined with

    def getSide(len,wid):
         """ Returns the length of a triangle side with an area of len * wid """                              

    and it is called with the statement

    tri_side = getSide(length,width)

    Make sure you use the parameters len and wid in the body of the function.

  4. Again, using this function as a model, add a fruitful function to calculate the value math.sqrt(length*width/math.pi)which appears near the end of the program. The function should be defined as
    def getRad(len,wid):                
    """ Returns the radius of a circle with an area of len * wid """

    and it is called with the statement

    radius = getRad(length,width)

    Make sure you use the parameters len and wid in the body of the function.

  5. Make sure your functions have the same parameters and the same comment as in the assignment description. Write a complete header comment.
  6. Create your own function and call it from main. Your function doesn’t have to do a lot, but it does have to do something.

Submission

  1. Submit the file with .py extension.
  2. Write a reflection in the comment box answering the following questions:
    1. Describe the new function you added. Give its name.
    2. In a sentence or two, what did you learn?
    3. In a sentence or two, what did you like about this project?
    4. In a sentence or two, what did you find confusing or would like to see done differently regarding this project?
    5. In a sentence or two, if you had another hour or two, what would you like to add to the project or how would you do things differently?

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20