# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

3 Pages

### EH17

Course: CPSC 150, Fall 2009
School: Christopher Newport...
Rating:

Word Count: 403

#### Document Preview

EH17 1 CPSC150 CPSC150 EH17 Q1: Consider integer array values, which contains 5 elements. Which statements successfully swap the contents of the array at index 3 and index 4? a. values[ 3 ] = values[ 4 ]; values[ 4 ] = values[ 3 ]; b. values[ 4 ] = values[ 3 ]; values[ 3 ] = values[ 4 ]; c. int temp = values[ 3 ]; values[ 3 ] = values[ 4 ]; values[ 4 ] = temp; d. int temp = values[ 3 ]; values[ 3 ] = values[...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Virginia >> Christopher Newport University >> CPSC 150

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.
EH17 1 CPSC150 CPSC150 EH17 Q1: Consider integer array values, which contains 5 elements. Which statements successfully swap the contents of the array at index 3 and index 4? a. values[ 3 ] = values[ 4 ]; values[ 4 ] = values[ 3 ]; b. values[ 4 ] = values[ 3 ]; values[ 3 ] = values[ 4 ]; c. int temp = values[ 3 ]; values[ 3 ] = values[ 4 ]; values[ 4 ] = temp; d. int temp = values[ 3 ]; values[ 3 ] = values[ 4 ]; values[ 4 ] = values[ 3 ]; Q2: In this question, assume a class, Book, has been defined. Which set of statements creates an array of Book objects? a. Book books[]; books = new Book[ numberElements ]; b. Book books[]; books = new Book()[ numberElements ]; c. new Book() books[]; books = new Book[ numberElements ]; d. All of the above. CPSC150 EH17 2 Q3: Assume array items contains the values 0, 2, 4, 6 and 8. Which of the following set of statements uses the enhanced for loop to display each value in array items? a. for ( int i = 0; i < items.length; i++ ) System.out.prinf( "%d\n", items[ i ] ); b. for ( int i : items ) System.out.prinf( "%d\n", items[ i ] ); c. for ( int i : items ) System.out.prinf( "%d\n", i ); d. for ( int i = 0 : items.length ) System.out.prinf( "%d\n", items[ i ] ); Q4: Which statement correctly passes array items to method takeArray? Array items contains 10 elements. a. takeArray( items[] ). b. takeArray( items ). c. takeArray( items[ ] 9 ). d. Arrays cannot be passed to methods--each item must be sent to the method separately. Q5: Consider array items, which contains the values 0, 2, 4, 6 and 8. If method changeArray is called with the method call changeArray( items, items[ 2 ] ), what values are stored in items after the method has finished executing? public static void changeArray( int passedArray[], int value ) { passedArray[ value ] = 12; value = 5; } // end method changeArray a. 0, 2, 5, 6, 12. b. 0, 2, 12, 6, 8. c. 0, 2, 4, 6, 5. d. 0, 2, 4, 6, 12. CPSC150 EH17 3 Q6: Write an application to simulate the rolling of two dice. The applicationshould use an object of class Random once to roll the first die and again to roll the second die. The sum of the two values should then be calculated. Each die can show an integer value from 1 to 6, sothe sum of the values will vary from 2 to 12, which 7 being the most frequent sum and 2 and 12 beingthe least frequent sums. The following figure shows the 36 possible combinations of the two dice. Your application should roll the dice 36,000 times. Use a one-dimensional array to tally the number of times each possible sum appears. Display the results in tabular format. Determine whether the totals are reasonable (e.g., there are six way to roll a 7, so approximately one-sixth of the rolls should be 7). 1 2 3 4 5 6 7 2 3 4 5 6 7 8 3 4 5 6 7 8 9 4 5 6 7 8 9 10 5 6 7 8 9 10 11 6 7 8 9 10 11 12 1 2 3 4 5 6
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:

Christopher Newport University - CPSC - 150
CPSC150 EH021CPSC150 EH02Q1: Which of the following is not a valid Java identifier? a.myValue b.\$_AAA1 c.width d.m_x ANS:Q2: Which of the following cannot cause a syntax error to be reported by the Java compiler? a.Mismatched {} b.Missing */ i
Christopher Newport University - PHYS - 151
PHYS151/August 26, 2008/Gerousis 1PHYS151 Intermediate Physics IFall 2008Instructor: Dr. Gerousis Office Phone: 594-7603 Department Office: 594-7065 Office: Room 128 Gosnold Hall Email: gerousis@pcs.cnu.edu Office Hours: I will be available in my
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationHistory &amp; TechnologySome figures from Computer Organization&amp; Design, The Hardware/Software Interface Copyright 2007, Morgan Kaufmann PublishersOverviewnComputer History 1st Transistor 1st Integrated Circuit (IC)
Christopher Newport University - ULLC - 100
1TE4ET A1 VOL E G6MI NCROWAVES7EL2TS E L ES T E I A I N T3MA X W E L R5MA R C O N A T IILLION6SA TE C T C T R I C O N I C2MOR A P H7ELE L L3PH4ON YSCILLONS
Christopher Newport University - PHYS - 151
Vectors and ScalarsChapter 3 Vectors A Scalar is a physical quantity with magnitude (and units). Examples: Temperature, Pressure, Distance, Speed A Vector is a physical quantity with magnitude and direction: Displacement: Washington D.C. is ~
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 5-III The Processor Datapath and ControlWhy a single-cycle implementation is not used today?n nnn nnnnSingle-cycle design can work correctly. However, it is not used in modern designs because it i
Christopher Newport University - ULLC - 100
OverviewComputer History 1st Transistor 1st Integrated Circuit (IC) 1st MicroprocessorULLC 100History &amp; TechnologyComputer Technology Chip Manufacturing Process World's Smallest Working Silicon Transistor World's Fastest Silicon Transisto
Christopher Newport University - CPSC - 330
MIPS Technologies CPSC 330 Computer OrganizationChapter 2-I Instructions: Language of the computerMIPS is the #1 architecture in several high-volume, high-growth market segments Boxes shipped with MIPS-Based Silicon Cable STB 75% Digital STB 40%
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 3-II Arithmetic for computers ALU designARITHMETIC LOGIC UNIT (How many bits?)ACC to Data BusENBufferLoad PathStore Path44Load ACCACCEN+4Data BusBAALUControl Unit (FSM) +ALU Control
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 7 Memory-I1Components of a ComputernThe five classic components of a computer- Datapath: Chapters 3, 5, and 6 - Control: Chapters 5, and 6 - Memory: Chapter 7 - Input/Output: Chapter 8ComputerProcess
Christopher Newport University - ULLC - 100
ULLC 100 - Evolution of Wired LifeQuiz 3 Chapter 2 The Ancient Mystery of Human KnowledgeName(s) _ Answer the following questions in the allocated spaces. 1. How does the author define data, information, knowledge, and wisdom?2. Briefly explain
Christopher Newport University - PHYS - 152
Potentially Useful Equations and ConstantsPhysical ConstantsSpeed of light Acceleration due to gravity Coulomb's Law Constant Planck's Constant Rydberg Constant Electron Charge Proton Charge Permittivity of Free Space Permeability of Free Space El
Christopher Newport University - PHYS - 152
Walker, Chapter 23 Magnetic Flux and Faraday's Law of InductionMichael Faraday, portrait by Thomas PhillipsInduced EMF (Voltage) from changing Magnetic FluxElectric currents produce magnetic fields. 19th century puzzle, can magnetic fields produ
Christopher Newport University - PHYS - 152
Let's review electromagnetismElectric GeneratorElectric Motor25 Electromagnetic WavesMaxwell's TheoryIn 1865, James Clerk Maxwell developed a theory of electricity and magnetism. His starting points were: Electric field lines originate on +
Christopher Newport University - PHYS - 152
Physics 152 Walker, Chapter 20Electrostatic Potential Energy Electrostatic PotentialElectric Potential and Electric Potential Energy Symbol for electric potential is V We will first define Electric Potential Energy. Symbol is U Scalar quantity (
Christopher Newport University - CPEN - 315
CPEN 315 - Digital System DesignDigital Circuit Verification Hardware Descriptive Language VerilogC. Gerousis Logic and Computer Design Fundamentals, 4rd Ed., Mano Prentice HallOverview More Structural Verilog Examples Dataflow Modeling Dat
Christopher Newport University - PHYS - 151
Welcome to Physics 151James Walker, Physics, 3rd Ed. Prentice HallPreliminary list of topics Walker, Chapters 1-18 Description of motion: Kinematics Position (in 1-, 2-, 3- dimensions), Velocity &amp; Acceleration Forces and Motion: Net Force equa
Christopher Newport University - CPEN - 315
CPEN 315 - Digital System DesignChapter 7 Registers and Register TransfersPart 1 Registers, Microoperations and Implementations C. Gerousis Logic and Computer Design Fundamentals, 4rd Ed., ManoPrentice HallCharles Kime &amp; Thomas Kaminski 200
Christopher Newport University - CPEN - 315
CPEN 315 - Digital System DesignChapter 5 Sequential CircuitsStorage Elements and Sequential Circuit AnalysisC. Gerousis Logic and Computer Design Fundamentals, 4rd Ed., Mano Prentice Hall Charles Kime &amp; Thomas Kaminski 2008 Pearson Education,
Christopher Newport University - PHYS - 151
Chapter 2 One-Dimensional KinematicsJames Walker, Physics, 2nd Ed. Prentice HallChapter 2 One-Dimensional Kinematics One dimensional kinematics refers to motion along a straight line. Even though we live in a 3-dimension world, motion can often
Christopher Newport University - CPEN - 315
CPEN 315 - Digital System Design Spring 2008Combinational Functions and CircuitsChapter 3 Logic and Computer Design Fundamentals, 4rd Ed., Mano 2008 Pearson Prentice HallOverview Functions and Functional Blocks Decoding Encoding Selecting
Christopher Newport University - PHYS - 152
Chapter 26 Optics I (Mirrors)LIGHTProperties of light: Light travels in straight lines:Laser Light travels VERY FAST How fast?At this spe d it can go around theworld 8 tim s in one e e se cond. C you think of an e pleto provethat light trave
Christopher Newport University - PHYS - 151
Chapter 4 Two-Dimensional KinematicsJames Walker, Physics, 3rd Ed. Prentice HallChapter 4: Two-Dimensional KinematicsMotion in the x direction is independent from motion in the y direction. We use the same equations from Chapter 2, but for each
Christopher Newport University - PHYS - 151
Chapter 3 VectorsVectors and Scalars A Scalar is a physical quantity with magnitude (and units). Examples: Temperature, Pressure, Distance, Speed A Vector is a physical quantity with magnitude and direction: Displacement: Washington D.C. is ~
Christopher Newport University - PHYS - 202
Chapter 26Capacitance and DielectricsCapacitors Capacitors are devices that store electric charge Examples of where capacitors are used include: radio receivers (tune frequency) filters in power supplies computer processors Internal
Christopher Newport University - PHYS - 202
Chapter 26Capacitance and DielectricsCapacitors! !Capacitors are devices that store electric charge Examples of where capacitors are used include:! ! ! ! !radio receivers (tune frequency) filters in power supplies computer processors Intern
Christopher Newport University - CPSC - 330
CPSC 330 Computer Organizations Exam will cover chapters 1, 2 and 4. Closed book and notes. No makeup, except for a valid documented case, typically an emergency or illness.What to expect: Definitions: e.g. Assembler Short answers: e.g. What
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 7 Memory-II1Designing the Memory System to Support CachesnMake reading multiple words easier by using banks of memoryCPU CPU CPUMultiplexor Cache Cache Bus Bus Bus CacheMemoryMemory bank 0Memory
Christopher Newport University - PHYS - 151
Chapter 5 Newton's Laws of MotionChapter 5: Newton's Laws of MotionWe will study classical motion: No quantum mechanics No relativity We introduce the concept of force and define it in terms of the acceleration of a &quot;standard body&quot;1Intuitive
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 5-IIThe Processor Datapath and Control1Controln n n nSelecting the operations to perform (ALU, read/write, etc.) Controlling the flow of data (multiplexors) Information comes from the 32 bits of the ins
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 4 Assessing and Understanding PerformanceOverviewnDefining performance Response time Throughput Relative performancen nMeasuring performance CPU performance and its factors Improving performance P
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationOverviewn n nCourse Schedule Introduction to Computer Organization Pre-requisite surveyCPSC330 CompOrg: Dr. Gerousis1About the Course - Computer OrganizationnCatalog Description: Study of computer organiza
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 6-IPipelining1Pipelining the laundry analogynnn n nSuppose you had to do 4 loads of laundry and each stage takes 30 minutes. Which is faster, doing it sequentially or pipelined? Timeseq = _ Timepipe
Christopher Newport University - CPSC - 330
CPSC 330 Computer Organization Final Review1Definitions &amp; Acronymsn n n n n n n n n nAcronyms and Definitions Hand-shake protocol Data Hazard DDR RAM Spacial locality DMA NUMA . . .CPSC330 CompOrg: Dr. GerousisReview 22T/Fn nnn n
Christopher Newport University - CPSC - 330
CPSC 330 Computer OrganizationChapter 6-II Pipelining1Problem 6.2nnnnA computer architect needs to design the pipeline for a new microprocessor. The workload program core consists of 1E6 instructions. Each instruction takes 100 ps to fi
Christopher Newport University - CPSC - 230
Class 3 (L33)x x x x x x xClient of a Class Purpose of Public Members Private Class Members Controlling Access Access Functions Predicate Functions Utility Function (Helper Function)Dr. Ming ZhangClient of a ClassA client of a class may bex
Christopher Newport University - CPSC - 230
Structures (L30)x x x x x x x x xSyntax of a struct Declaration Structure Variables Accessing Members of Structures Initialize Structure Variables Array of Structures Accessing the Array of Structures Rules When using Structures Case Study Exercis
Christopher Newport University - CPSC - 495
/* Samples of Using Shell */ -Special Characters 1 (Metacharacters) -* Executing the Commands: Using Single Back Quotation \$ echo The date and time is: `date`. The date and time is: Wed Dec 10 13:12:20 EST 1997. * sequencing the Commands: Using the
Christopher Newport University - CPSC - 495
/* jg85.cc * Using a lock file as a process communication technique * John Gray, Inrerprocess Communications in UNIX, P.85 */ #include &lt;stdio.h&gt; #include &lt;sys/types.h&gt; #include &lt;unistd.h&gt; #include &lt;sys/wait.h&gt; #include &lt;stdlib.h&gt; #include &lt;limits.h&gt;
Christopher Newport University - CPSC - 150
CPSC150 EH251CPSC150 EH25Q1: The convention of the UML is to denote the name of an abstract class in: a. bold. b. italics. c. a diamond. d. there is no convention of the UML to denote abstract classesthey are listed just as any other class.Q2
Texas Tech - ETD - 07022008
CHANGES IN PERSONAL CHARACTERISTICS OF MEXICAN-AMERICAN HIGH SCHOOL GRADUATES AND DROPOUTS DURING THE TRANSITION FROM JUNIOR HIGH TO HIGH SCHOOL by MARTHA BLANSITT PURSLEY, B.A., M.Ed. A DISSERTATION IN EDUCATIONAL PSYCHOLOGY Submitted to the Graduat
Texas Tech - ETD - 05032005
A PHENOMENOLOGICAL APPROACH TO UNDERSTANDING THE CHANGES IN MARTIAL INTIMACY FOR CAREGIVERS MARRIED TO A SPOUSE WITH ALZHEIMER'S DISEASE by MARK STEPHEN ADAMS, M.S. A DISSERTATION IN MARRIAGE AND FAMILY THERAPY Submitted to the Graduate Faculty of Te
Texas Tech - ETD - 07312008
CELL CYCLE PROTEIN INTERACTION WITH TELOMERASE IN A BREAST CANCER CULTURE SYSTEM by T. KEVIN COOK, B.S.A THESIS IN BIOLOGY Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the Degree of MASTE
Texas Tech - ETD - 07312008
STRATEGIES IN ALUMNI DEVELOPMENT FOR FINE ARTS PROGRAMS IN HIGHER EDUCATION: A PLAN FOR TEXAS TECH UNIVERSITY DEPARTMENT OF THEATRE AND DANCE by TOBYN LEIGH. B.G.S.A THESIS IN THEATRE ARTS Submitted to the Graduate Faculty of Texas Tech University
Texas Tech - ETD - 07312008
ROLE TRANSITIONING OF NEWLY APPOINTED DEPARTMENT CHAIRS IN INSTITUTIONS OF HIGHER EDUCATION IN TEXAS by GLORIA STEWART, B.A., M.P.A. A DISSERTATION IN HIGHER EDUCATION Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment
Texas Tech - ETD - 07312008
HIGHER EDUCATION DEVELOPMENT OFFICERS' USE OF AFFINITY-SEEKING STRATEGIES IN SOLICITING CONTRIBUTIONS by CHUCK COHNAN EDWARDS, B.B.A., M.Ed. A DISSERTATION IN HIGHER EDUCATION Submitted to the Graduate Faculty of Texas Tech University in Partial Fulf
Texas Tech - ETD - 02262008
INCREASING FACULTY DIVERSITY IN HIGHER EDUCATION: A CASE STUDY OF THE EVOLVING ROLE OF THE CHIEF DIVERSITY OFFICER AT THREE PUBLIC UNIVERSITIES IN TEXASby Birgit Green, B.B.A., M.Ed. A Dissertation In HIGHER EDUCATION Submitted to the Graduate Facu
Texas Tech - ETD - 07312008
SUPERRESOLUTION OF REAL IMAGE SEQUENCE by ZHANPENG FENG, B.S.E.E.A THESIS IN ELECTRICAL ENGINEERING Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the Degree of MASTER OF SCIENCE IN ELECTRI
Texas Tech - ETD - 09102008
Cytotoxicity of Selenocyanobiotin Against MDA-MB-231 Breast Cancer Cellsby I-Huei Tsai, B. S.A Thesis In NUTRITIONAL SCIENCES Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the Degree of
Texas Tech - ETD - 11252008
PSYCHOLOGICAL WELL-BEING OF SIBLINGS IN LATE ADULTHOODbyCATHERINE NICHOLE MORELOCK, B.S. A THESIS IN HUMAN DEVELOPMENT AND FAMILY STUDIES Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the
Texas Tech - ETD - 08272008
CANYON NORTHAN ALTERNATIVE TO IN LUBBOCK^ LIVING TEXASPresented to A.D. Thompson: Professor DIVISION OF ARCHITECTURE TEXAS TECH UNIVERSITTIn Partial Fulfillment of the Requirements for the Bachelor of Architecture Degreeby: David Vayne Secrest
Christopher Newport University - CPSC - 150
Chapter 1 Introduction to Computers, Programs, and JavaBasic computer skills such as using Windows, Internet Explorer, and Microsoft Word Chapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3
Christopher Newport University - CPSC - 150
Chapter 3 Control StatementsBasic computer skills such as using Windows, Internet Explorer, and Microsoft WordChapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3 Selection Statements Chap
Christopher Newport University - CPSC - 450
J. Berry; CPSC 550Page 1 of 8Extending the Capability of Massively Multiplayer Online Games by Introducing Distributed Systems as World ServersJason Berry CPSC 550 Spring 2005 Dr. Ming ZhangJ. Berry; CPSC 550Page 2 of 8Table of Contents
Christopher Newport University - CPSC - 450
AbstractTitle: Name: Date:Reducing Network Latency: Using an intelligent Service to Determine the Cheapest Communications Solution. Paul Norman Johnson 21 April 2005 As the number of users on a computer information network grow, the needs of the
Christopher Newport University - CPSC - 150
CPSC150 EH301CPSC150 EH30Q1: Which of the following statements is not true? a. Exception handling enables programmers to write robust and fault-tolerant programs. b. Exception handling can only catch the exception but cannot resolve the exceptio
Christopher Newport University - CPSC - 426
CPSC426 JavaEH411Exercise/Homework EH41Q1: Which of these is not an example of a &quot;real-life&quot; collection? a.The cards you hold in a card game. b.Your favorite songs stored in your computer. c.The players on a soccer team. d.The number of pages
Christopher Newport University - PHYS - 404
Texas Tech - ETD - 07312008
FORAMINIFERAL BIOSTRATIGRAPHY AND PETROGRAPHY OF THE LOWER PEN FORMATION (UPPER CRETACEOUS), BIG BEND REGION, TRANS-PECOS TEXAS by RICHARD ALLEN ASHMORE, B.S.A THESIS IN GEOSCIENCE Submitted to the Graduate Faculty of Texas Tech University in Parti
Texas Tech - ETD - 08272008
LOWER VALLEY HIGH SCHOOL El Paso, TexasPresented to: Assistant Professor Dr. H. Nelson Division of Architecture Texas Tech UniversityIn Partial Fulfillment of the Requirements of the Bachelor of Architecture Degreeby; Jesus Jaime December 12, 1
Texas Tech - ETD - 09262008
OPTIMIZED BAND ELIMINATION AND DIMENSIONALITY REDUCTION OF HYPERSPECTRAL IMAGES by SANDHYA BORRA, B.E.A THESIS IN ELECTRICAL ENGINEERING Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the D