New User Special Price Expires in

Let's log you in.

Sign in with Facebook


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


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

CS 159: Intro to Computer Science - Study Guide

by: India Bergeland

CS 159: Intro to Computer Science - Study Guide CS 159

Marketplace > Purdue University > ComputerScienence > CS 159 > CS 159 Intro to Computer Science Study Guide
India Bergeland
Intro to Computer Science
William Crum

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

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

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Intro to Computer Science
William Crum
Study Guide
50 ?




Popular in Intro to Computer Science

Popular in ComputerScienence

This 13 page Study Guide was uploaded by India Bergeland on Thursday October 16, 2014. The Study Guide belongs to CS 159 at Purdue University taught by William Crum in Fall. Since its upload, it has received 597 views. For similar materials see Intro to Computer Science in ComputerScienence at Purdue University.


Reviews for CS 159: Intro to Computer Science - Study Guide


Report this Material


What is Karma?


Karma is the currency of StudySoup.

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

Date Created: 10/16/14
Exam 2 study guide CS 159 Smte39t True I False It is pessible tu dnetelanihe if paramneters are passed ta ta fhsietieu 0nC address iirem the deelaratieu statement sf the Pa It is pessihl e ta tir iE111iJ1E if any parameters are pza ed ta a fhrietieu address tirenl an exanlpie eall ten the flllltt li It is pessihle tu dnetermihe if J1ji39 parameters are passed ta ta fhsietieu 5 address based en the iirst line ef the de IIitieI1eF the 8 A funeties1 that pass at ist ehe 8 8 address must pass them aii by address If the ealliug funetiair is gaining tu pass 6 its ieeal variables 6 address ta anether eietieu then i1i1E EI ffB5JI4I1tZiii g sariahie in the ealted 4 III1Istha39ve the same idehtifier Aii funetieras that utiiiae pass b2 addre must be F1it1fuJ1netiarise If p 1 1 j use ef pna B address then aii fuhetieras in the 0 must use ef pass by address Rather than passing the eII1gr39 paiameter by address ter a are id it is better te make use at the return statenlerit in the metieu ten the needed value ten the xiiirig the benefit at pass by addrem is that it allews mutipi e ehahges ta he made in a metieu and ten have these I391 Ft39ig E quotuquot iEi2i1 in the tiling funetieh Witlr the use hf pan f address it is 0 permissihte fer a fuhetieh ta be ta eemplete severai sub tashs ef the ii1 lI7tEl EIM7 werlzirig with a that has been passed by addrem it is urmeeessary te use the E Qadldress eperater in the scanf because the aileadgi 139E1l39E5rEI39it5 memerjr ieeatieu The and eperaters are iriserse eperatimis eF eaeh ethen Chapter 5 selection Logical Data and Operators 51 0 Not 0 And ampamp 0 False ampamp anything false 0 OR ll 0 True II anything true 0 Precedence on ampamp before II 0 COMPLIMENTS O X lt y X gt y 0 X gt y X lt y 0 X y X O X lt y X gt y 0 X gt y X lt y 0 X y X y Two Way Selection 52 0 ifelse rules 0 eXpression must be in parenthesis 0 no semicolon needed 0 if else statement is null remove it 0 a dangling else is always paired with the most recent unpaired if 0 Conditional expressions 0 Expression expressionl expression2 0 If expression is true expressionl is executed else expression2 is executed alternatives D r 3 W Multiway selection 53 Sio any 0 Switch statement used to make a deci 1r Switch Statement rules TTTTTTFTTTFTT T TFTT False ampamp anything false True II anything true Chapter 6 repetition Concept of a loop 61 0 loop iteration one execution of the instructions in the body of the loop 0 loop control expression the logical expression to determine whether or not the loop should continue with another iteration 0 loop initialization preparation work to be completed before the execution of the loop body 0 loop update an executable statement found inside the body of the loop when executed a sufficient of times will change the evaluation of the loop control expression 0 loop control variable variable that s initialized is part of the loop control expression and is updated inside the body of the loop Pretest and Post test loops 62 0 pretest the loop control expression must be true prior to iterating the loop even one time 0 Minimum times iterated O 0 Post test the instructijons of the body of the loop will be executed prior to the first evaluation of the loop control expression 0 Minimum times iterated 1 Event and counter controlled loops 64 0 Counter controlled loops can count the number of iterations Controls the number of times an action or set of actions body of loop is to be repeated 0 Factorial problem 0 Event controlled an event takes place and changes the loop control expression from true to false and brings the repetition to an end Cant count number of iterations The While loop pg 310 0 Pretest construct 0 No semicolon The for loop pg 315319 0 Has an initialization statement the limit test expression and updating expression 0 Pretest loop 0 Counter controlled 0 All for loops can be converted to Whiles The doWhile loop pg 319 320 0 Terminated with semicolon 0 Post test construct Recursion pg 349 353 0 A repetitive process Where a function calls itself 0 Recursive case continuing of repetition through a function call 0 Base case when if statement is false Weve achieved base case Loops in structure charts pg 365 0 An infinite loop is a logical error Stntet Thee Flse The lump ni139ehrriiailiIe iE t39ItIl1Il39Il1quot peht ef the lhmpa enntrei espreien and the l39eeipieIt T ef the eetiehs sf lhimpa u1pdste The humh eftitnes the eumtnil elpreisieh is eealusteci equals the hhtrIhet fiiterstie11s in s prnsttest p T The eetiehs i inside the hp pi a pretest leap will he Blf i lll li at least he liE1 The LiIiliEli39339Eiitltil ef the leap ehntml vsrihllex must take plsee hirle iheferej a pretest Imp The hprlete t the P eehtml verziehlles me he fehnd iI39lEitllE the herljr f a leap er may he s F part i the eimhpll elpressieh T The hprlete t the enhtml verzishlles is respehsihle iiiItl39llIl1hIl i1i lg the p heeshse it will eveiihisllgi r ult iii the limp emltml e1pmsiu11 hi heihp false T The J1hE efstes t the llIltF ll1F I i lliE lWEjE equals the Z lllttlhi if eff lhnma iterettiens iii a pretest pihp eehstrhet If pee ssh rlet mine the hhtnher f times p setiehs fished iii the hedlp ef the p are eseehtetl T theh pee have s eniII1tIerei1mtm4le pisses Eetrse TI is it the use pf hirielh t tertiiihete arty repetitieh Werhihpg with a date set i an size is eh etemple ref sh e1ent eimtmllle ftI lthl F A limited i it i39 eumtIiiI strmetures is peiimissihle iii the msii1 fimetieh t P that it is the insih flll ii il which Ltlil li I1es1 ef the ihhetin mlls fer a p T 1 ill eedle ihtihd inside the hedlpr sf 3 repetiiilen elmstzruet must he intlemted mtsetly tw sdrlitiI1el speees It is NOT ACCEPTABLE to make use of a return statement Within a loop to terminate both the loop and the function A limited amount of control structures is permissible in the main function to ensure that it is the main function which makes most of the function calls for a program It is not acceptable to use recursion with eventcontrolled repetition problems The update expression is evaluated after every evaluation of the loop control expression If all three expressions for a for loop are not needed you should use a while loop instead The for loop is an iterative repetition construct Smtet It39nel39 Fise The yr way t step apregarr1 with art intiiite p is shut dlewe peer terraiuai Eeleetien isrtt us with iuput ttali atiert lbemuse it presides eulp a R nsinher at F eppentunities the user t input lmlitil data It is eztpeete that the fer the 39 1itil 39ii eF input he feunti in the same 4 that eerutairts the t fer input tquotttil seauf Efmtiell tti In this pets will he mtpeetetl te ealitlate the input ef the range at aeeeptehlle 39tquotHiIl1a 1tZl the earre eta type T A limited K t t f39quoten11trnI strnettlres selxeeti eu repmiti is perrnissihle in the meiu irtetien te that it is the rnai I1 which makes rest i 1ueti ert ealls f a Input ttalie atiert is an esampie ejti an ierent eentrnll1e1i prehiem T in nite inep is a lgieal errer T 1 F the appreaeh te petentiailp selring that require riesteti ps msier is te seperate itt ttlll repelitis39e prneess itnte its IWI tianetrinii Jlueeertlirtp ta the eetuse standards a fer Ieep sh 1 early he used with ennntereentrnlllled T preeesses ueeertiirtp te the eeerse standards if all three eitpsessiens are net Iteerieni in a fer p pI pen sheulti insteeai make ese eff a stt1i1e p fer peer prmiest leaping needs T T lltii srhi1e ps ean he srerteti iiite fer leaps fen t39EJ1 maize ttse ntht st st 1 anti at is 1 iiiterehaiigeahlp as the mate Ifthir espamsmlen ef a fer leap The pet eempiler as ttseni en the sageiesprlrrtiueenhs serrer this sernester will permit a sairiahle T te he llttil initialised iu the first mtpressieu ef a fer ieep See pages 3i lE 3i 119 The nptlate E391iIt E5Eil lltilfa fer lp reap j unite use ef the a itiert er sahtaeti T Et1E1 EItl1 iJ1Eil1lt2lEt5 E E 1 3 A neat temp is a repetitive 0V eess signed efanetiter repetitive t e eess The redirection of output will include those output statements requesting input from the 3 user The redirection of input results in the input prompts appearing on the same line because there is no user physically striking the enter key on the keyboard in between input The redirection of output to an existing file will NOT result in an error J L neetelzl Innip E5 1 repe tive Z efmmeiliner ruwetitive e Eeemrmiem 8 E 1 EpEt1i1iE ETEHJE Q 3 ea s itself AI1 iterative selmienz name that uses 1 leepiug ieeeetruet as E 1r1ile je 1rI1ile er f er Use the rIaE1Le he ew te traee rljhe exeem etlzl efrljhe lIllZI111l139lI laiquotiIEI l Irl mliem Value ef ii E Vmlme nil J int i D E J int j feriji 1 i s T ij ji 2 T139ii5 pay Elna Iltuej1ilnm1IiI395 v eaIa at rrar rEirsv uaJ


Buy Material

Are you sure you want to buy this material for

50 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

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."

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

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


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


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:

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

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.