3 Pages

modelMidTerm

Course: SC 196, Fall 2009
School: Syracuse
Rating:
 
 
 
 
 

Word Count: 535

Document Preview

196: CPS Introduction to Computer programming: C Sample midterm exam 1. A C compiler detects _______________. a. syntax errors b. run-time errors c. result errors d. arithmetic faults e. all of the above 2. For what exact range of values of variable x does the following code segment display the letter 'C'? if (x <= 200) if (x < 100) if (x <= 0) printf("A\n"); else...

Register Now

Unformatted Document Excerpt

Coursehero >> New York >> Syracuse >> SC 196

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
196: CPS Introduction to Computer programming: C Sample midterm exam 1. A C compiler detects _______________. a. syntax errors b. run-time errors c. result errors d. arithmetic faults e. all of the above 2. For what exact range of values of variable x does the following code segment display the letter 'C'? if (x <= 200) if (x < 100) if (x <= 0) printf("A\n"); else printf("B\n"); else printf("C\n"); else printf("D\n"); a. 0 < x < 100 b. x <= 0 c. 100 <= x <= 200 d. x > 200 e. 100 < x <= 200 3. If num is a variable of type int and temp is a variable of type double, how could you correctly complete this function call? scanf("%lf%d", _________); a. num, temp b. &num, &temp c. temp, num d. &temp, &num e. none of the above 4. Assuming that x = 2, y= 3, and z=2, what value is assigned to r in the statement r = f(z, x, y); if f is defined as follows? int f(int a, int b, int c) { int p; p = c * a + 3 * b; return (p); } a. 13 b. 15 c. 12 d. 14 e. none of the above 5. What is displayed by the C statements at the right if the value input is 3? a. Equal b. Less c. Greater d. Error scanf("%d", &n); if (n = 5) printf("Equal\n"); else if (n < 5) printf("Less\n"); else printf("Greater\n"); Questions 6 and 7 concern the following program fragment: char r, x, y, z, w; scanf("%c%c%c%c", &x, &y, &z, &w); if (x < y) r = x; else r = y; if (r > z) r = z; if (r > w) r = w; printf("%c\n", r); 6. What is the program output if the user types runt followed by a carriage return the when program is run? a. r b. u c. n d. t e. none of the above 7. The program's effect can best be described as __________. a. It displays the letter 'r' after comparing it to x, y, and z. b. Of the four input characters, it displays the one that comes first in the alphabet. c. Of the four input characters, it displays the one that comes last in the alphabet. d. Of the four input characters, it displays the one that comes second in the alphabet. e. It displays nothing since characters cannot be compared. 8. The decision table below shows fines imposed for speeding violations. Write a detailed algorithm for aprogram that assigns the correct fine to type double variable fine based on the value of type int variable speed. You have to write detailed psudocode and draw the equivalent flowchart. Speed (mph) 65 or less 66-70 71-75 76-80 over 80 Fine ($) $0 $ 15.00 $ 30.00 + 5 * (number of miles over 65) $ 50.00 + 10 * (number of miles over 65) $ 75.00 + 15 * (number of miles over 65) ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Syracuse - SC - 196
LECTURE 1 INTRODUCTION1. DEFINITIONSComputer Program: - It is a sequence of Instructions used to operate a computer to produce specific results.Programming: - It is the process of writing these instructions in a language that the computer can res
Syracuse - SC - 196
CPS 196 Introduction to Computer Programming: Cmultidim arrays addresses &quot;debugging&quot; OverviewMultidim array initialization Bug, defect Debugging Debugging with Visual Studio Array example Array example with function call MultiDimensio
Syracuse - SC - 196
CPS 196 Introduction to Computer Programming: Caddresses pointers examples OverviewAddresses of variables Basic types: Passbyvalue Arrays: Passbyreference Pointers scanf a function that modifies an array a function that modifies an int
Syracuse - SC - 196
LECTURE 19 FILESA File is a collection of related data and that resides on secondary storage, e.g. on disks. The C library contains a large number of routines for manipulating files. The declarations for the structures and functions used by the file
Syracuse - SC - 196
LECTURE 22 DATA STRUCTURESData Structures is an organization of information for better algorithm efficiency, such as queue, stack, list, and tree. Although the terms data type, data structure and abstract data type sound alike, they have different m
University of Hawaii - Hilo - EALL - 272
Yukio Mishimaphoto by http:/mishima.online.frDied by seppuku on November 25, 1970. &quot;Death by sword was a beautiful death; the act of seppuku the ultimate Beauty.&quot; Born in 1925. Was nominated for the Nobel Prize in 1965. Questions on &quot;After the Ba
UCSC - CMMU - 148
Walnut Avenue Womens Center California Advocacy Certification Training!In only two months you can become a certified Advocate for Victims of Domestic Violence. Advocates provide referrals, court accompaniment, restraining order services, and support
Bowling Green - M - 648
0.03 10.493 10.855 11.184 11.283 11.48 11.776 12.138 12.5 12.763 12.993 13.224 13.421 14.178 14.441 05.691 15.855 06.941 06.941 17.993 08.882 18.882 19.145 011.48 111.513 112.105 012.796 112.993 013.849 016.612 017.138 0
Bowling Green - M - 648
MATH 648 Homework 4Chapter 5: ex 1, 3Chapter 6: ex 2, 4, 5
Bowling Green - M - 648
Example of Bayes rule There is a carnival game where darts are thrown at a board. The board is subdivided into a large number of small squares labeled with one of the numbers 1, 2, 3, 4, 5, 6. The object of the game is to throw a set number of dart
University of Hawaii - Hilo - BIOL - 1000
The Evolution of Animal DiversityCopyright 2003 Pearson Education, Inc. publishing as Benjamin CummingsANIMAL EVOLUTION AND DIVERSITY 18.1 What is an animal? Animals are eukaryotic, multicellular heterotrophs that ingest their food They lack
Minnesota - CBS - 6011
BioC 6011Lecture 16 (47) Alex Lange Wednesday Nov. 27, 2002Protein SynthesisStarting point - mRNA is fully processed and ready to participate in protein synthesis. 1) the codon reader - tRNA, small (between 73 and 93 ribonucleotides), has the ant
Allan Hancock College - LAWS - 1072
Contracts 2 - Session 2 2003 Outline to week 3 Identifying contractual terms Incorporation of terms by signature L'Estrange v F Graucob Ltd 322 Curtis v Chemical Cleaning and Dyeing Co 324 Incorporation of terms by notice Oceanic Sun Line Special Sh
UCSD - MAE - 124
MAE 124/ESYS 103: Spring 20091Week 9 Assignment: Transportation Planning for UC San Diego: Trains, Buses or Automobilesdue in section Thursday May 28 or Friday May 29, 2009 Name: ID:San Diego Association of Governments (SANDAG) long-range tran
N.C. State - ARE - 201
ARE 201 Spring 2009, Lab #7Name _KEY_Fill in the blank with the correct answer.1. A tax paid for a product or service by the person who directly consumes that product or service is called a _user fee__.2.The broadest and most comprehensive
N.C. State - ARE - 201
ARE 201 Spring 2009 Final Exam Answers, Version A (question 1 beginning with &quot;Economics exists to&quot;) 1. C 2. B 3. C 4. D 5. A 6. B 7. C 8. D 9. A 10. C 11. A 12. D 13. B 14. C 15. D 16. A 17. D 18. A 19. A 20. B 21. B 22.
Wilfrid Laurier - PHYS - 347
%!PS-Adobe-3.0 %Creator: Gnome Print Version 2.8.1 %CreationDate: D:20060104102411 %LanguageLevel: 2 %DocumentMedia: Regular 612 792 0 () () %Orientation: Portrait %BoundingBox: 0 0 612 792 %Pages: 3 %PageOrder: Ascend %Title: %DocumentSuppliedResour
UNF - MAC - 1147
MAC 1147STUDY GUIDE FOR THE FINAL1.) Finding the domain of a logarithmic function. (The question will require solving a polynomial or rational inequality). (Reference: Example 5 on page 263 and Exercise 53 on page 270.) 2.) Expanding and condensi
UNF - MAC - 1147
Summer 2005. Precalculus (MAC 1147; Section 285).Instructor/office/contact info/office hours: Instructor: Dr. Ognjen Milatovic Phone: 620-1745 Office: Building 14, Room 2733 E-mail: omilatov@unf.eduWeb page: http:/www.unf.edu/~omilatov Office hour
UNF - MAC - 1147
MAC 1147STUDY GUIDE FOR TEST 11.) Simplify an expression using rules of exponents and radicals. (Reference: Exercises 6783 on pages 691692.) 2.) Perform operations on complex numbers. (Reference: Exercises 13, 19, 27, 41, 35, 53, 59, 73 on page 6
UNF - MAC - 1147
MAC 1147STUDY GUIDE FOR TEST 21.) Performing composition of functions. Finding components of a composite function. (Reference: Examples 2 and 4 on pages 225227; Examples 6 and 7 on pages 228229.) 2.) Finding the inverse of a one-to-one function.
USC - ARCH - 416
USC ARCHITECTURE Centre d'Etude d'Architecture et d'Urbanisme 16 rue Charles Dangibeaud 17100 Saintes, France T/F 05.46.93.00.50 ARCH 425,426 - FIELD STUDIES IN ARCHITECTURE AND TECHNOLOGY Instructors: Victor Jones, Selwyn Ting Fall 2002 SYLLABUS PED
Minnesota - STAT - 5302
STAT 5302 Applied Regression Analysis. Hawkins Homework 9The fitted model is Response = VALUE Terms = (P {F}YEAR {F}COUNTY {F}YEAR*P {F}COUNTY*P {F}COUNTY*{F}YEAR) Coefficient Estimates Label Estimate Std. Error t-value p-value Constant 1076.50 161.
University of Hawaii - Hilo - ART - 258
Kapi'olani Community College Art 258 Interface Programming II In-class Presentation Week 15BArt 258 : Interface Programming II : Week 15 : B: CalendarWeek 15 11.28 11.30 FINAL - final site is due Week 16 12.5 12.7 FINAL portfolio presentationW
University of Hawaii - Hilo - ARCHIVE - 0506
Honolulu Star-BulletinPage 1 of 4Article URL: http:/starbulletin.com/2006/02/12/features/story02.html 1996-2006 The Honolulu Star-Bulletin | www.starbulletin.comVol. 11, Issue 43 - Sunday, February 12, 2006BURL BURLINGAME / BBURLINGAME@STARB
Wilfrid Laurier - PHYS - 347
R. Ouyed/PHYS347Phys357 Thermodynamics (Course Notes: Part I)by Prof. Rachid Ouyed1Part I: ContentR. Ouyed/PHYS347 3. Historic 7. General definitions and concepts 25. Gases (Ideal and non-ideal) 37. The zeroth and first law 57. First l
Wilfrid Laurier - PHYS - 347
Assignment #1Thermodynamics (Phys345) R. Ouyed Due Jan. 23, 20061Generalities Complete the table below by entering &quot;No&quot; or &quot;Yes&quot; . Table 1: default Variable V 1/V V/N V2 /N V2 P/V PV 1/T T2 Intensive Extensive What is the difference between
Wilfrid Laurier - PHYS - 347
Assignment #5Thermodynamics (Phys347) R. Ouyed Due March 31st, 20061Problem 1 (5 marks)Derive the relation for (CP,m - CV,m ) for a gas that follows a van der Waals' equation. The subscript &quot;m&quot; stands for molar quantities. Start with CP - CV =
Wilfrid Laurier - PHYS - 347
Assignment #6Thermodynamics (Phys347) R. Ouyed Due Monday April 10, 200611.1Water anomaly (10 Marks)Problem 1 (5 Marks)Conventional wisdom has it that ice skating is possible due the pressure induced melting of ice by the skate blade which g
Minnesota - MAPSERVER - 038
Counties Trapped 2004Countiescounties trapped counties not trapped:0 25 50 100 150 Miles 200 Universal Transverse Mercator NAD 1983 Zone 15
Penn State - MLC - 359
ABC CompanyItem 1 Item 2 Item 3 Item 4 Item 5 total 6 Month Budget Forcast january february march april may june $680.00 $685.00 $690.00 $695.00 $700.00 $705.00 690.00 695.00 700.00 705.00 710.00 715.00 700.00 705.00 710.00 715.00 720.00 725.00 710.
Penn State - MLC - 359
marissa campbell 06/22/2009 12:26:58Chesterton TribuneBimonthly Projected Earnings and Expendituresec em be ua ry us t be r r ne Au g ct o ta ls To br ril ApRevenueSubscriptions Advertising TotalsFeJuO12,178.30 4,130.20 16308.50 2054.8
Penn State - MLC - 359
Assumptions Units Sold in Prior Year Unit Cost Annual Sales Growth Annual Price Decrease MarginMARISSA CAMPBELL 06/22/2009 12:29:2911,459,713 13.40 4.50% 4.25% 39.25%Salioto Auto PartsEight-Year Financial ProjectionYe ar 1 r 2 Ye ar 3 r 4 Y
Penn State - MLC - 359
MARISSA CAMPBELL 06/22/2009 12:38:37Millenium SteelAnnual Growth for the next five yearsr1 r2 r3 r4 r5 ye a ye a ye a ye a ye aSales Cost of Goods Gross Margin Totals Assumptions Prior Year's Sales Annual Growth Rate Annual Cost Rate Premium4
Penn State - MLC - 359
Scissors Office SupplyAnnual SalesBostonConsumer Small Business Large Business Government Nonprofit Total $206,348.81 235,573.28 237,317.55 178,798.04 15,180.63 $873,218.31Miami$113,861.40 133,511.24 234,036.08 144,548.80 28,837.75 $654,795.27
Penn State - MLC - 359
Walk and Rock MusicFirst Quarter Rock-It MP3 SalesVideo Mini Micro Flash AssessoriesTotal Northwest Southwest Midwest South West $66,145.15 $79,677.10 $34,657.66 $52,517.20 $99,455.49 31375.24 82937.72 66137.5 30681.82 43595.24 27596.37 92716.32 8
Penn State - MLC - 359
Spoke-Up Bicycle ShopBurr HillsBicycles Accessories Repairs RefreshmentsTotal $11,869.20 8,106.93 4,158.58 3,437.64 $27,572.35Third Quarter Sales Frankfort Hillside Shepley$7,430.90 5,731.09 8,665.31 1,013.08 $22,840.38 $7,158.62 3,742.30 5,217
Penn State - MLC - 359
Eric's Used BooksAnnual Sales1st Quarter 2nd Quarter23,273.13 2,189.43 1,759.17 8,942.80 1,382.01 37,546.54 32,680.09 9,779.52 4,755.66 4,412.90 4,574.00 56,202.173rd quarter15,787.59 3,019.34 3,180.71 4,212.90 3,403.60 29,604.14Used Books Ma
Penn State - MLC - 359
El Centro DinerPayrol ReportEmployee Vincent Flores Wonda Jefferson Anthony Sanchez Alexa Martin Maria Reyes Lori Romanoff Carmen Alvarez Peter Lane Claudi Moreno Wayne Vargas Totals Average Highest Lowest Dependent s 1 2 2 3 1 2 1 4 1 3 2 4 1 Rate
Penn State - MLC - 359
Silver Dollars Stock Club Portfolio SummaryInitial Price 12/1/04 12/16/03 1/17/03 12/11/02 2/20/04 11/14/05 9/14/04 1/14/05 9/10/03 Shares Per Share 440 64.59 870 28.71 960 49.46 380 33.62 920 390.32 770 34.54 990 74.08 950 42.13 560 17.79 760 990 3
Penn State - MLC - 359
marissa campbell 06/22/2009 12:27:24RockieView Resort &amp; SpaAnalysis of Indirect Expensestotal net revenue cost of sales direct expenses banquet room $345,819.00 19,750.00 9,245.00 $10,394.16 16,414.60 $6,513.67 3,347.62 7,637.64 8,203.69 $52,511.
Penn State - MLC - 359
Calories Burned per Hour WorksheetActivity Aerobics class Brisk walking House work Office work/sitting Sleeping Standing Swimming Tennis Walking Totals Average Highest Lowest Total Pounds Lost Calories Burned Average Hours Total Calories per Month (
Cornell - ARCH - 366
ARCH 366/666 The Tectonic Articulation of StructureFall 2004 3 creditsPrerequisites: ARCH 262, ARCH 263, ARCH 264, ARCH 363 or equivalent courses in structures and technology, or permission of the instructor.Image by Monika Sarac, ARCH 366, Sprin
Utah - CS - 6640
CS6640 Project 1 Assigned Jan. 22, 2009 Due Feb. 3 (Just before midnight) GoalsThe purpose of this project is for you to develop the software platform you will use for the course (C+ or Matlab), to get familiar with the process and expectations for
Cornell - ENGL - 2080
Cheat sheet for Shakespeare in LoveLittle things:signing his name: Why does the camera focus early on Will experimenting with his signature? . blotting lines: Why is Will shown blotting and blotting lines in his manuscript? (Norton 1, 1585-86) &quot;br
Cornell - ARCH - 465
NEW COURSE! FALL 2006ARCH 465 (4605) Special Topics in Construction: Fire Safety A seminar examining advanced topics in building fire safety Prof. Jonathan Ochshorn 3 credit hours, Prerequisite: ARCH 262/562 or permission of instructor Satisfies &quot;te
RIT - P - 09541
Project Status Update P09541 UAV Imaging PlatformJoshua Jones (Mechanical Engineer)EDGETM Project Name UAV Imaging Platform Project Number P09541 Project Family Imaging &amp; Color Science Track Printing and Imaging Systems Technolog
Central Washington University - OMIS - 480
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|31 Mar 2005 22:04:38 -0000 vti_extenderversion:SR|4.0.2.7802 vti_cacheddtm:TX|31 Mar 2005 22:04:38 -0000 vti_filesize:IR|31744 vti_cachedlinkinfo:VX| vti_cachedsvcrellinks:VX| vti_cachedtitle:SR|DEPARTM
Laurentian - BIOL - 1020
Phylum Porifera (the pore bearers) 1. 2. General Characteristics Phylogenetic context Species diversity and associated habitats `germ layers'? Body Plan A perforated sac containing special cells (Fig. 33.3) Cell types: choanocyte, porocyte, ame
N.C. State - ENGR - 517
Objectorienteddesign:discoveringobjectswithCRCcards.1 ReedPhillips,PresidentofKnowledgeSystemsCorporation introducesthetape. Question:HowdoIdistributetheresponsibilityacross collaboratingobjectssothattogethertheysolvemyproblem? Objectsdecomposeprobl
N.C. State - ENGR - 517
Smalltalk:Smalltalkwasoriginallydeveloped attheXeroxPaloAltoResearchCenter. Smalltalk72. Smalltalk74.BitBltgraphicsadded. Smalltalk76.Majorredesign. Smalltalk80. SmalltalkwasreleasedtononXerox researchlabs.Ou tlin e for Le ctu re 2 I. Sm allt
N.C. State - ENGR - 517
(Somelanguagessupportmultiple inheritance.) Thus,anobjectrespondstomessages thatareimplementedinthedefinitionof itsclass,and Thesetofallmessagesthatanobject respondstoiscalleditsmessage protocol. Ifasubclassdefinesamessagewiththe sameselectorasam
N.C. State - ENGR - 517
Instancemethodsvs.classmethods: Instancemethodsmessagesthat instancesunderstand. Example:(Apoint(x,y)isdenoted x@y.)+ delta Ou tlin e for Le ctu re 4 I. Inst .&amp; cla ss met hs. II. Met acl ass es III.1998EdwardF.Gehringer CSC/ECE517LectureNotes,
N.C. State - ENGR - 517
Stringandtextclasses:Astringcanbe indexedlikeanarray.(Infact,itisa subclassofArrayedCollection.) at: at:put: size Therearealsoseveralroutinesthatare specifictoStrings. asNumber Givesthenumeric equivalent.O u tli n e fo r L e ct u r e 5 I. S tri1999
N.C. State - ENGR - 517
%!PS-Adobe-3.0 %Title: (g6lec6s.msw) %Creator: (Microsoft Word: LaserWriter 8 8.4.2) %CreationDate: (12:33 Monday, January 25, 1999) %For: () %Pages: 17 %DocumentFonts: Symbol Helvetica Helvetica-Bold Helvetica-Oblique %DocumentNeededFonts: Symbol He
N.C. State - ENGR - 517
Objectorienteddesignmethodologies:An objectorientedmethodologyisdefinedas thesystemofprinciplesandprocedures appliedtoobjectorientedsoftware development. Currently,thereisnostandard methodologythathasbeenadopted bythesoftwareindustry. Manydifferent
N.C. State - ENGR - 517
TheanalysisanddesignofaSmalltalk application. TheOOA&amp;DProcess TheSpiralModel:Noonewilldisputethatoo programmingisadifferentwaytodevelop programsfromtraditionalmethods. However,expertsdisagreeaboutthebest wayinwhichtodevelopdesignsthatwill beimplement
N.C. State - ENGR - 517
Codingthevideostoreapplication:Today wewillseehowtheBoochdesignforthe videostoreapplicationcanbetranslated intoSmalltalkcode. Therearetwocaveatsabouttodays code: Itwillnotincludeanyuserinterface elements(windows,buttons,dialogs, etc.).Thatwillbecove
N.C. State - ENGR - 517
BuildingwindowsinVisualWorks:Inthe previoustwolectureswehaveseenhow youdesignasystemusingoo techniques,andhowanoodesigncan beimplementedinSmalltalk. Inthislecture,wewillwrapupthisseries bylookingathowtousethewindowing featuresofVisualWorkstobuildaGUI
N.C. State - ENGR - 517
%!PS-Adobe-3.0 %Title: (g6lec10s.msw) %Creator: (Microsoft Word: LaserWriter 8 8.4.2) %CreationDate: (9:38 Wednesday, February 10, 1999) %For: () %Pages: 8 %DocumentFonts: Symbol Helvetica Helvetica-Bold Helvetica-Oblique Courier TimesRoman Courier-B
N.C. State - ENGR - 517
GUIprogramminginSmalltalk:Wehave alreadyseenhowgraphicaluser interfacesareprogrammedin VisualWorks\Smalltalk. Letusreviewthethreemajorsteps. 1. DrawtheinterfaceusingtheBuilder 2. 3.O u tli n e fo r L e ct u r e 1 0 I. B ui1998EdwardF.GehringerCSC51