Provide the code for a boolean-valued function perfectnthat


1. Alternating sums

Provide code for an integer-valued function altSumSquares(n) that calculates and returns as its value the alternating sum of the squares of the first n positive integers. You may not use a formula to calculate this value, but must use a loop.

2. Perfect Numbers

Provide the code for a Boolean-valued function perfect(n)that calculates and returns the Boolean value True or False according to whether the value of the parameter n is a perfect number or not, respectively.

3. Forcing good input

Provide the code for a function inCirlcle(pt, cirlcle) that returns True or False depending on whether the given Point object pt lines inside the given circle(the boundary is excluded).

You should then create a program that presents a main window to the user with a circle that has a center and radius of your choice, but do not draw the circle.  The user will be expected to locate the circle by clicking in the window until the mouse has clicked inside the circle. If the user clicks the mouse but it is not in the circle, the message "Clicksome number. Circle missed, try again"must be displayed at the bottom of the window.  Here some number represents the number of mouse clicks the user made so far in attempting to find the circle. Once the user clicks inside the circle, the program should display both the circle, the point where the user clicked, and the bottom of the window, the message, "It took you some number of clicks to find the circle."

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Provide the code for a boolean-valued function perfectnthat
Reference No:- TGS01579238

Expected delivery within 24 Hours