×

### Let's log you in.

or

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

×

or

## Programming Fundamental Notes

by: Natalie Notetaker

2

0

6

# Programming Fundamental Notes CS 1334

Marketplace > University of Texas at Dallas > CS 1334 > Programming Fundamental Notes
Natalie Notetaker
UTD

Enter your email below and we will instantly email you these Notes for Programming Fundamentals

(Limited time offer)

Unlock FREE Class Notes

Everyone needs better class notes. Enter your email and we will send you notes for this class for free.

not many notes; the class spent more time on Khan Academy website to create assignments
COURSE
Programming Fundamentals
PROF.
Gordon Arnold
TYPE
Class Notes
PAGES
6
WORDS
KARMA
Free

## Popular in Department

This 6 page Class Notes was uploaded by Natalie Notetaker on Thursday August 18, 2016. The Class Notes belongs to CS 1334 at University of Texas at Dallas taught by Gordon Arnold in Spring 2016. Since its upload, it has received 2 views.

×

## Reviews for Programming Fundamental Notes

×

×

### 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: 08/18/16
● byte ­ has 8 bits  ● 255 as largest, 0 as smallest  ● parameters ­ numbers and data  ○ for example: rect(x, y, width, height, radius*)  ● literals ­ numbers in (X,Y,...)  ○ increasing X value, moves to the right  ■ decreasing X value, moves to the left  ○ increasing Y value, moves down  ■ decreasing Y value, moves up  ● pixel at upper left corner is 0, 0  ○ 400 pixels across and 400 going down  ○ pixel at lower right corner is 399, 399  ● must put “ ; “ at end of parameter in order to the shape  ● z order  ○ to have a shape on top of another, move a parameter to another spot, above to  have shape behind another or below to have shape in front of another  ● processing.org/reference  ● triangle(x1, y1, x2, y2, x3, y3)  ○ triangle (x1, y1) is first point  ○ triangle (x2, y2) is second point  ○ triangle (x3, y3) is third point  ● background (r, g, b) is color of background  ○ inside ellipse is fill, outside is stroke  ○ don’t want an outline? type “noStroke();”  ○ don’t want fill? type “noFill();”  ● capitalization (noFill, noStroke, …) is very important    1/20/16  ● RGB stands for Red, Green, Blue  ○ HSB ­ hue saturation brightness  ○ values  ■ black is 0, 0, 0  ■ White is 255, 255, 255  ■ red is 255, 0, 0  ■ green is 0, 255, 0  ■ blue is 0, 0, 255  ■ magenta is 255, 0, 255  ■ cyan is 0, 255, 255  ■ yellow is 255, 255, 0  ○ 256 shades of gray  ● subtracted color ­ pigment absorb light  ● pixel ­ stands for picture element  ● transparency, or “alpha” ­ the 4th value of color  ○ fill(w, x,​ ​)  ● #FFCØC7  ○ FF ­ red  ○ CØ ­ green  ○ C7 ­ blue  ● string ­ a series of characters used as data, not as a name  ● text(“2+2=”(2+2) shows 2+2=4  ○ text(“2+2=”+2+2) shows 2+2=22    1/25/16  ● 2 types of storage  ○ primary storage ­ stuff goes away when computer is off  ■ hard drive or anything similar takes longer to get information  ■ CPU cannot use secondary memory  ○ secondary storage ­ stuff that doesn’t go away when computer is off  ● how much memory? bases off on what is being put there  ● VAR ­ short for variable  ○ can change what’s in a box  ● will say “38”  ○ var bob;  ○ bob = 38;  ○ fill(0);  ○ textSize(bob);  ○ text(bob,50,50);  ● to solve:  ○ p = 5  ○ q = NA  ○ r = NA  ■ p = 5  ■ q = 38  ■ r = NA  ● p = 5  ● q = 38  ● r = 3  ○ q%p  ■ 38/5 = 7  ■ 38%5 = 3 (the remainder of 7)  ● represented by variable ­ degree of freedom    2/1/16  ● position  ○ speed = ▯ pos  ○ acceleration = ▯ speed  ● translation ­ moves 0,0 point to someplace else  ● rotation ­ rotates around 0,0 location always  ● scale ­ bigger or smaller  ● pushMatrix() ­ has no functions  ● popMatrix() ­ has no parameters    2/8/16  ● 1st paradigm ­ linear programming, “spaghetti code”  ● objective oriented  ● return ­ stop the function  ● var add = function(one,two){  ○ var c = 1+2;  ○ return c;  ● var q = add(5,7);  ■ 5 and 7 are arguments  ● arguments ­ bit of info passing when calling a function  ○ value of arguments get placed in parameters  ● parameters ­ variables that function uses to get information from the outside  ○ minimum number of parameters a function can have: 0  ○ don’t have to have parameters  ○ no parameters, can’t pass arguments!    2/29/16    ● what is programming?  ○ telling a computer what to do  ■ sequential ­ doing things in order  ● literal is any value you type in  ○ x = 10 (10 is literal)  ● variable can hold a value and doesn’t necessary have a written  value in code  ○ store functions in a variable  ■ selection/conditional  ● “if” statements  ■ repetition  ○ values  ■ numbers  ■ numbers with decimal points  ■ characters  ■ strings of characters  ● sequences of characters  ● noted as a literal with quotes  ● “Hello”/‘Hello’ is a string literal  ● are put in order, based on numbers representing them, not letters  ■ buleum values  ● either true or false, no in­between  ● everything that can be put into variable can be translated into  either true or false  ● drawing basics  ○ commands used to draw?  ■ must know the parameter lists  ■ rect(x,y,w,h), triangle(x1,y1,x2,y2,x3,y3), ellipse, quad, point, line, arc  ■ colors  ● standard mode: RGB (red, green, blue)  ● (hues, saturation, and brightness)  ■ want to color?  ● fill and stroke can have 1, 3, or 4 parameters  ● if there were 3, the parameters represent RGB  ● 16.2 million colors using red, green, and blue  ○ 256 options for red  ■ 2^8  ○ 256 options for green  ■ 2^8  ○ 256 options for blue  ■ 2^8  ○ 2^8 = 2^24 + 2^8 = 2^32  ■ colorMode  ■ no longer color outside a shape?  ● no stroke  ■ no longer color inside a shape?  ● no fill  ■ no longer color the canvas?  ● no background  ■ color a line or point?  ● use stroke  ■ color text?  ● use fill  ○ know the codes  ■ black 0,0,0  ■ red ff,0,0  ■ green 0,ff,0  ■ blue 0,0,ff  ■ magenta ff,0,ff  ■ yellow ff,ff,0  ■ cyan 0,ff,ff  ○ web color to RGB color  ● when we animate, we need a variable for the aspect that you want to animate  ○ animate y­position?  ■ need a variable for y­position  ○ rotate + 1 = clockwise  ○ call back function is one that you define but computer  ● arguments goes into parameters ()    p q 1p p&&q p||q  f f t f f  f t f f t  t f f f t  t t f t t    3/9/16  for() loops has 3 parts inside ()  ● happens once before going into loop    ● Arrays  ○ Declaring  ■ Var x = [ ]  ■ Var y = [ 3, true, color(0,0, 255)]  ■ Var z = [3, 2, 1, 4, 0]  ● In place of numbers: 3 is 0, 2 is 1, 1 is 2, 4 is 3, 0 is 4  ■ Var a = z [ z [ z [ 0 ] + z [ 2 ] ] ]  ● Equals = 3  ○ Z[0] = 3  ○ Z[2] = 1  ● A = z [ z [ 4 ] ]  ○ A = z [ 0 ]  ■ Var q = [ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ]  ● Q [ 0 ] = [ 0, 1, 2 ]  ● Q [ ​1 ​] ​ ] = ​[ 3, ​ ]​ = 5  ● Recursive case  ○ When a function calls itself  ● Writing comments  ○ // for single line  ○ /*, */ for multiple lines  ○ /** or /*** ?  ● Looping  ○ For loops, while loops, do­while loops  ● Bolian factors  ○ <, <=, >, >=, !==, ===  ● true/false table  ○ p  !p p q p&&q p||q p||!p p&&!p  ○ F T F F F F T F  ○ T F F T F T T F  ● T F F T T F  ● T T T T T 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

Jim McGreen Ohio University

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Jennifer McGill UCSF Med School

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over \$500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

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