CS 2500 2017 notes 2 PDF

Title CS 2500 2017 notes 2
Course Fundamentals Of Computer Science 1
Institution Northeastern University
Pages 3
File Size 51.2 KB
File Type PDF
Total Downloads 108
Total Views 152

Summary

Download CS 2500 2017 notes 2 PDF


Description

cs2500:Pr ogr ammi ngBasi cs I nt r oRepeat s     



Mywebsi t e( ccs. neu. edu/ home/ nt uck) Cour sewebsi t e( ccs. neu. edu/ cour se/ cs2500) Homewor k:Cour seWebsi t e,Submi tonBl ackboar d Pi azza:Si gnupandmak esur et ochecki tr egul ar l y-annoucement swi l l bemadeher e,and par t i ci pat i on( goodquest i ons/answer s)mayhel py ourwhi m gr ade.Don’ tpos tcode. Readi ng: o Thes yl l abusont hecour sesi t egi vest het opi csf oreachcl ass . o Fi ndt heassoci at edsect i onsi nHTDP2eandr eadt hem bef or ecl ass . o Thenagai naf t ercl ass. Ti mesf orbot hexamsar epost ed.Mak esur et ol etusknowi fanyconfli ct sdev el opbef or et he exams.

Al gor i t hms Whati s142+229? Howdoyoucal cul at e142+229? Howdoyout eachacomput ert oaddt wonumber s ? Howdoyout eachacomput ert odost uff? Howdoyout eachaper sont ot eachacomput ert odost uff?

TheBasi cs Rul e1:Val ues:Ent erav al ue,gett hatv al ueback . Defini t i onspane:Thepr ogr am y ou’ r ewr i t i ng. I nt er act i onpane:Runsi ngl el i nesofcodeandseet her esul t . Ki ndsofv al ue:-Number s-I nt eger s-Rat i onal Number s( e. g.2/ 3)-Appr oxi mat enumber s( e. g.pi , sqr t2)-I mages-St r i ngs-Doubl equot e,somes t uff,doubl equot e Howdoweev al uat eaf unct i on? f ( x)=x+5f ( 3)=? Rul e2:Funct i ons/oper at i ons:   

Openpar en,oper at i on,ar gument s,cl osepar en Gi v est heval ueofappl yi ngt hef unct i ont ot hear gument s . Rul ei st hesameasf ormat h.Pl ug&Chug

Rul e3:Nes t i ng  

Ev al uat et hei nner mos tpar ensfir st . Fornowatl east ,wecanr epl aceanyf unct i onappl i cat i onwi t hi t sr esul t i ngval ue.

Val uedefini t i ons : (define NUM 5)

Funct i ondefini t i ons: (define (function x y) (+ x y 1))

Ar i t hmet i cofNumber s     

Wesawsomebasi car i t hmet i coper at i onsl astt i me. ( +34)-“ +”i saf unct i ont hatt ak est woar gument sandgi v esust hesum. ( sqr5)-“ sqr ”i saf unct i ont hatt ak esonear gumet nandgi vesusi t ssquar e. add1 add2? o Defineourownf unct i on o Showcheckexpect s

Ar i t hmet i cofI mages      

Togetani mage,weei t herpast eonei norwecanbui l dt hem. ( ci r cl e20“ sol i d”“ bl ack” )gi vesusaci r cl e. ( ci r cl e40“ out l i ne”“ bl ue” )gi v esusadi ffer entci r cl e. ( aboveC1C2)i saf unct i ont hatcombi nest woi mages,byst i cki ngt hem t oget herver t i cal l y . ( over l ayC1C2)st i ckst hem ont opofeachot her . Ther ear eabunchmor eoper at i ons.Ri ghtcl i ckon“ ci r cl e”andhel pdeski t .Scr ol l ar oundabi t .



Addanoper at i on:Donut ( define( donutcol or )( over l ay( ci r cl e20“ sol i d”“ whi t e” )( ci r cl e40“ sol i d”col or ) ) ) ( define( donut 2s i z ecol or )( ov er l ay( ci r cl e( /si z e2)“ sol i d”“ whi t e” )( ci r cl esi z e“ sol i d”“ col or ” ) ) )

 

empt y scene pl acei mage

Ar i t hmet i cofSt r i ngs  

Newki ndofv al uet oday:St r i ngs Oper at i ons:

o o o o

st r i ngappend st r i ngl engt h subs t r i ng  Hal fopeni nt er val ,z er oi ndexed.Why? t ext:St r i ng>I mage

Backt ot heRock et  



Hei ghtf unct i on( “ hei ghtf r om gr oundi npi x el s ” ) . o check expect s Dr awf unct i on o Tak ehei ght ,mak ei mage. o Demopl acei mage o Demoempt y scene bi gbang o Howt odr aw?( t i me>i mage) o Howt ogetnextt i me ?( number>number )...


Similar Free PDFs