×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

## IT 210

by: Ahmed Notetaker

6

0

2

# IT 210 210

Ahmed Notetaker
Minnesota State University, Mankato
GPA 3.1

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

Monday week 4 of it 210
COURSE
Fundamentals of Programming
PROF.
Salivia, Guarionex
TYPE
Class Notes
PAGES
2
WORDS
CONCEPTS
information technology
KARMA
25 ?

## Popular in Information technology

This 2 page Class Notes was uploaded by Ahmed Notetaker on Thursday September 22, 2016. The Class Notes belongs to 210 at Minnesota State University - Mankato taught by Salivia, Guarionex in Fall 2016. Since its upload, it has received 6 views. For similar materials see Fundamentals of Programming in Information technology at Minnesota State University - Mankato.

×

## Reviews for IT 210

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/22/16
WEEK 4 (MONDAY) IT 210 # Practice making functions #import math from math import *  # imports everything from the module                     # without the need to call the module by name def circumference(radius:float):     c = 2 * pi * radius     return c def areaCircle(radius:float):     a = pi * pow(radius, 2)  # radius ** 2     return a # Archimedes approximation of Pi def archimedesPi(n:int):     angle = radians(360 / (2*n))     pie = n * sin(angle)     return pie #result = archimedesPi(100) #print(result) #HOW GOOD IS ACHIMEDES APPROXIMATION OF PI? # numOfSides = 10000000 # for i in range(3, numOfSides + 1): #     sub = abs(archimedesPi(i) ­ pi)  # positive difference #     print(sub) # Accumulators # Accumulates the the sum of numbers from 1­5 acc = 0 for x in range(1, 6):     acc += x print(acc) # Sum of numbers between 0­200 x = 0 for i in range(201):     x += i print(x) # Sum of odd numbers between 1­100 x = 0 for i in range(1, 101, 2):     x += i print(x) # Sum of the first 100 evens x = 0 num = 201 for i in range(0, num, 2):     x += i print(x) # Average of numbers from n to m def average(n, m):     acc = 0     avg = 0     for i in range(n, m+1):         acc += i     if(n != m):         avg = acc / abs(n ­ m)     return avg a = average(20, 20) print(a) # Factorial def factorial(n):     acc = 1     for i in range(1, n+1):         acc *= i     return acc f = factorial(100) print(f)

×

×

### BOOM! Enjoy Your Free Notes!

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over \$600 per month. I LOVE StudySoup!"

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com