1 Page

InClassExercise18

Course: CSCI 112, Fall 2007
School: Lake Forest
Rating:
 
 
 
 
 

Word Count: 205

Document Preview

In-class CS112: Exercise 18 More with ArrayLists. 1. 2. 3. 4. 5. Copy the InClass18 folder from the usual locations. Open the project using BlueJ. Edit the source file for InClass18. Note that this already contains a testRun and a max method. Note that ArrayList<type> requires that type be of an object type and not a primitive type. So for integers, you must use the class type Integer, and not int....

Register Now

Unformatted Document Excerpt

Coursehero >> Illinois >> Lake Forest >> CSCI 112

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.
In-class CS112: Exercise 18 More with ArrayLists. 1. 2. 3. 4. 5. Copy the InClass18 folder from the usual locations. Open the project using BlueJ. Edit the source file for InClass18. Note that this already contains a testRun and a max method. Note that ArrayList<type> requires that type be of an object type and not a primitive type. So for integers, you must use the class type Integer, and not int. For example, ArrayList<Integer> arrayOfIntegers; 6. The testRun() method is used to test the max method. Note how the testRun() method declares, instantiates, and adds integers to an array so that can we invoke max on the array and print out the results. 7. Exercise A. Program a min(ArrayList<Integer> a) method that will return an int that is the minimum of the integers in the array. Modify the testRun() so as to test this new method. Invoke the testRun() method for testing. 8. Exercise B. Program a average(ArrayList<Integer> a) method that will return a double that is the average of the integers in the array. Be careful with dividing two integers if you do not wish the result to be rounded down. Modify the testRun() so as to test this new method. Invoke the testRun() method for testing.
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:

Lake Forest - CSCI - 112
CS112: In-class Exercise 19 More with ArrayLists.Copy the InClass19 folder from the usual locations. Open the project using BlueJ. Edit the source file for InClass19. Note that this already contains a testRun method. Note the global instance variab
Lake Forest - CSCI - 112
CS112: In-class Exercise 21 try &amp; catch Exception0. Review of try-catch syntax. For any code that might throw an exception. try{ any code here that might throw an exception }catch(Exception exceptionVariable){ /the catch clause this part is execute
Lake Forest - CSCI - 112
CS112: In-class Exercise 23 Extracting words from a sentence and characters from a word 0. Review of the split method. The split method when applied to a string. someString.split(pattern) will return a String[] object (a true array of String). Here s
Lake Forest - CSCI - 112
CS 112 Major Lab #1 Tic-Tac-ToeDue: Monday, October 1, 5pm How: Submit printouts to me, and save a copy of the project in your network account folder. Working alone, solve the following programming assignment. Keep in mind that academic dishonesty i
Lake Forest - CSCI - 112
CS 112 Major Lab #2 A Banking Application(version 1.2) Due: Monday, October 29, 5pm How: Submit printouts to me, and save a copy of the project in your network account folder. Working alone, solve the following programming assignment. Keep in mind t
Lake Forest - CSCI - 112
CS 112 Major Lab #4 BabyNames Application Part2(version 1.2) Due: Wednesday, November 21, noon. How: Submit printouts to me, and save a copy of the project in your network account folder. Working alone, solve the following programming assignment. K
Lake Forest - CSCI - 112
CS112: In-class Exercise 16 ArrayList an improved spell checker. 1. Review of the new ArrayList object. Required import: import java.util.*; Declaration: ArrayList&lt;type&gt; variableName; Instantiation: variableName = new ArrayList&lt;type&gt;(); Adding new e
N.C. State - D - 231
Brittani Chirichella 11/26/07 D231 Section 001At the Metropolitan Museum of Art, there are an immense amount of paintings deserving of more than just a passing glance. In particular, Springtime, author Pierre-Auguste Cot, drew my attention immediat
N.C. State - D - 231
Brittani Chirichella 11/26/07 D231 Section 001During the late 19th century, Pierre-Auguste Renoir was invited by the French government to complete a painting for a museum in Paris. As his subject, he chose Two Young Girls at the Piano, to illustrat
LSU - SOCL - 3501
1/25/08 Strain theories : merton, cohen, cloward, agnew General strain theory micro-level theory o Negative affective states: negative emotional states that lead to deviance. Ex : depression, anger, fear Sources of strain: o Failure to achieve posit
LSU - MGT - 4523
Management 4523FMLA: All employers are required to provide FMLA leave (FALSE) Every employee is eligible for FMLA if they have a qualifying event (FALSE) Employers and employees have notice requirements (TRUE) In lieu of having leave designated as
LSU - MGT - 4523
Chapter 1: Organizational Behavior and Foundation CompetenciesCompetency- is an interrelate set of abilities, behaviors, attitudes, and knowledge needed by an individual to be effective in professional and managerial positions. 7 core of competenci
Cincinnati - BIOL - 301
Lecture 22 Synthesis of Membrane Lipids Proteins made on bound ribosomes Posttranslational modifications Movement to Golgi via coated vesicles Golgi sorting Lysosomes Functions Endocytosis Receptor mediated PhagocytosisAnnouncements Tom
Cincinnati - BIOL - 301
Lecture 23 Lysosomes Targeting of proteins Role in organelle turnover Endocytosis Different types Receptor mediated Phagocytosis Cytoskeleton General aspects MicrotubulesAnnouncements TAs will hold review session for lab on Friday in l
Cincinnati - BIOL - 301
Lecture 24 Vesicular transport by microtubules Motor proteins Intermediate Filaments Assembly Different types Lamins and nuclear breakdown Microfilaments Assembly Motor Proteins (myosins) Sliding filament model for muscle contractionAnn
GWU - FILM - 153
History of World Cinema I Class notes review for final Surrealist Cinema: Luis Bunuel and Salvador Dali Luis Bunuel -Un Chien Andalou (1927) -Viridiana (1961) -Thank God I am still an atheist! -Vachel Linsed The Art of the Moving Picture (1915) -po
GWU - FILM - 153
NARRATIVE FILM NOTES (TEXT) MIDTERM REVIEW CHAPER 1 ORIGINS Latham Loop Example of how technology and art are bound together in cinema Permits films of greater length aesthetic consequences Loop = the loop added in film strip above and below projec
GWU - SPHR - 108
The Auditory System Peripheral Auditory System o Outer Ear o Middle Ear o Inner Ear Central Auditory System o Auditory Nerve o Brainstem Pinna-you can see it, it gathers sound Cochlea-hearing mechanism Vestibular-balance system Tympanic-usually invol
Pittsburgh - BIOSCI - 0050
PROCEDURE FOR QUESTION 2: EFFECT OF SUBSTRATE CONCENTRATION 1. You will follow the procedure you used in Exercise 6, the baseline experiment (See pages 1011) but you will use the new mixing table. You will need to do a new Baseline experiment using 2
Princeton - PHY - 104
Printed Name:9 9 9 9 9 Please Circle your Class am V. Muthukumar am T. Rothman am J. Fowler am A. Giuliani am I. Yavin Time/Instructor 10 am V. Muthukumar 10 am T. Rothman 10 am M. Aizenman 10 am D. Haldane 10 am W. Happer Problem 1 2 3 Total Score
Drexel - MATH - 121
Princeton - PHY - 104
Physics 104 Overview, Structure, and Procedures Spring 2008Overview Though Physics 104 is a continuation of Physics 103, the subject matter is quite different. We will cover electricity and magnetism in both its fundamental and applied aspects. The
Princeton - PHY - 104
Princeton UniversityWeek Dates (Start on Tues after week 1) Feb 4-8 Feb 11-15 Feb 18-22Physics 104, Spring 2008TopicsSyllabus (as of Mar. 6, 2008)Laboratory (Starts Monday of week 2) No lab Lab I. Electroscope Lab II. Intro to DC circuits1 2
NYU - ECON - Stats
Statistics (V31.0018)NEW YORK UNIVERSITY DEPARTMENT OF ECONOMICS Statistics V31.0018.009 Spring 2008 MTW 12:30 p.m. - 1:45 p.m. SILV 520 Instructor: Naoki Sudo naoki.sudo@nyu.edu 19 W. 4th St., Rm 630 Office hours: Mondays and Tuesdays 2:00 p.m. -
E. Illinois - CMN - 3920
1Brian Ayers Public Relations in Society CMN 3920 4-1-07 Corporate Spying: Another part of our brave new world2 Description. Gone are the days of the only known spying was in the novels of John Le Carre. There was no James Bonds in this case. No
E. Illinois - BUS - 2801
Drinking at EIUCourse: Business StatisticsBusiness 2810 Brian Ayers Due April 27,2007College and drinking have always been synonymous with each other ever since students are allowed to drink. Alcohol has been a part of college life since the fir
North Shore - CMP - 104
Michael Craveiro Dr. Altomari CMP 104 14 November 2007 The dream of one day growing into a man saturates the mind of every boy. Some will draw their picture of what a man is from the many male influences in their lives, regardless if they are good or
Cornell - ECON - 1110
Econ 101 Introduction to MicroeconomicsProfessor Richard V. Burkhauser4The Market Forces of Supply and DemandKey Concepts market, p. 64 competitive market, p. 64 quantity demanded, p. 65 law of demand, p. 65 demand schedule, p. 65 demand
Cornell - ECON - 1110
Econ 101 Introduction to MicroeconomicsProfessor Richard V. Burkhauser1IntroductionWhy am I Here?Econ 101 Professor BurkhauserWhat do they have in common?George Stigler Jeff LarrimoreMilton Friedman Ted SchultzRonald Coase Gary Becker
Cincinnati - BIOL - 301
Biology 301, Exercise # 6,7 Measurement of Succinate Dehydrogenase in Mitochondria1,2 Introduction Mitochondria contain the enzymes necessary to complete the oxidation of glucose and other molecules, begun in the cytoplasm. Using glucose catabolism a
Cincinnati - BIOL - 301
Enzyme Kinetics Grading Sheet January 24, 2008 (at the beginning of lecture all sections) Notebook 1. Goal of the lab (5) 2. Flow chart (15 points total) 3, Record observations (5) 4. Record results. (5)_ _ _ _Lab Report 1. Introduction (5) _ 2.
Cincinnati - BIOL - 301
Biology 301, Exercise #2 Enzyme Kinetics of -GalactosidaseIntroduction Enzymes as Catalysts. Enzymes are a subgroup of proteins which catalyze biochemical reactions. Without enzymes most necessary chemical reactions in our bodies would be unable to
Cincinnati - BIOL - 301
Guide for Writing Lab Results 1. For each lab, you will hand in a carbon sheet from your lab notebook. Each lab exercise lists specific items that must be included for full credit. In each case, you are expected to write an introduction that indicate
Cincinnati - BIOL - 301
Formal Report Instructions Cell Structure and Function Please follow the instructions found in the handouts. In addition to these instructions, please also adhere to the following instructions. In the Methods section, tell what was done. Do not give
Cincinnati - BIOL - 301
Mitochondria II March 3, 2008 Notebook 1. Goal of the lab (5) 2. Flow chart (10 ) 3, Record observations (5) 4. Record results. (5) Lab Report 1. Introduction (10) 2. Materials and Methods (10) 3. Results (15) Tables and figures should each have titl
Cincinnati - BIOL - 301
Possible Experiments 1. We have other substrates of the TCA cycle available (citrate, -ketoglutarate, and isocitrate). Some reactions might be assayed with the assay we used for succinate dehydrogenase, while the assay might be less likely to work wi
Cincinnati - BIOL - 301
Succinate Dehydrogenase in MitochondriaPurpose: to investigate activity of succinate dehydrogenase in the presence of increased enzyme, increased substrate, and various other conditionsBroken mitochondriaAlso research malate DH No azide
Cincinnati - BIOL - 301
Biology 301, Winter 2008 Laboratory SyllabusTAs:Sukanya Chaudhury, Laura Kastner, Dominic Mao, Tim Meeker, Prem Rajkumar, Annette Stowasser Each of these TAs are responsible for a specific section. They will also hold office hours during the week
Cincinnati - BIOL - 301
Biology 301, Winter 2007 Lecture SyllabusInstructor: Dr. Katherine Tepperman e-mail: Katherine.Tepperman@uc.edu Office: 833 Rieveschl Phone: 556-9742. Office Hours: M 2:30-3:30, T 2-3, W 10-11, H 10-11 in 833 Rieveschl, and by appointment. TAs: Suk
Cincinnati - BIOL - 301
Name_ (print) Lab Section_ Cell Structure and Function Midterm #1 February 1, 2008There are 7 numbered pages to this exam including this one. Please check now to be sure that you have a complete copy. Answer in the space provided. There blank sheet
Cincinnati - BIOL - 301
Name_ (print) Lab Section_ Cell Structure and Function Midterm #1 February 1, 2008There are 7 numbered pages to this exam including this one. Please check now to be sure that you have a complete copy. Answer in the space provided. There blank sheet
Cincinnati - BIOL - 301
Name_ (Print) Section (TA)_ Cell Structure and Function Midterm#2 February 27, 2008There are 7 numbered pages to this exam including this one. Please check now to be sure that you have a complete copy. Answer in the space provided. If you use the l
Cincinnati - CLAS - 335
Professsor: Dr. Thea K. Smith Email: thea.smith@uc.eduOffice: 217 Blegen Phone: 556-317015-CLAS-335-901Celtic &amp; Norse Myth &amp; ReligionSpring 2008Prospectus: This is an introductory class designed to acquaint students with the myths and relig
Cincinnati - JUDC - 233
15JUDC233-001 ANCIENT STORIES OF CREATION, SPRING 2008WEEK ONE (Mar. 31, Apr. 2, Apr. 4) THE IDEA OF CREATION Mon. Mar. 31: Introductory Remarks; Syllabus Review Wed. Apr. 2: Myth and Creation; Ancient vs. Modern Models Fri. Apr. 4: What's a Cosmog
Cincinnati - ASIA - 303
1. 2. Instructor: Japanese 303 Noriko FUJIOKA-ITOOffice and Office hours: Office: 620I Old Chemistry 556-2747 Office hours: 2:00-2:50 PM MW or by appointment Email address: Noriko.Fujioka@uc.edu Time and place: 1:00-1:50 PM MWF McMicken 252
Cincinnati - GEOL - 126
World Regional Geography: Asia 126 and 126H300 Braunstein Hall MWF 1010:50 Spring QuarterMs. Fink reserves the right to modify this syllabus as conditions warrant.Instructor: Office: Office Hours: Telephone: Email: TA:Nissa Fink 416 Braunstein
Cincinnati - CHEM - 203
CHEMISTRY 203_ PRACTICE EXAM, CHAPTERS 17 AND 18 APRIL, 2008 Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Question 7 Question 8 Question 9 _ _ _ _ _ __ _ _ _ (9 points) (5 points) (20 points) (10 points) (15 points) (5 points) (6
Cincinnati - CHEM - 203
Welcome toCHEM 203Professor: Joel ShulmanTA's: Derek Jones Dan LewallenInformation for Chemistry 203Prof. Shulman Office: 200 Crosley Phone: 556-9212 E-mail: joel.shulman@uc.edu Office Hours: Tuesday &amp; Thursday, 9:30-11:00 a.m. Wednes
Cincinnati - CHEM - 203
Addition of N NucleophilesAmmonia, 1 aliphatic amines, and 1 aromatic amines react with the C=O group of aldehydes and ketones to give imines (Schiff bases).O CH3 CH + H2 N Acetaldehyde Aniline H+CH3 CH=N An imine (a Schiff base)+ H2 OO+
Cornell - ECON - 1110
Econ 101 Introduction to MicroeconomicsProfessor Richard V. BurkhauserIncome Inequality in the 1990sBurkhauser, Richard V., Kenneth A. Couch, Andrew J. Houtenville, and Ludmilla Rovba. Income Inequality in the 1990s: Re-forging a Lost Relationsh
Cornell - ECON - 1110
Econ 101 Introduction to MicroeconomicsProfessor Richard V. Burkhauser3Interdependence and the Gains from TradeKey Concepts absolute advantage, p. 52 opportunity cost, p. 53 comparative advantage, p. 53 imports, p. 57 exports, p. 57Econ
Saint Louis - PHILOSOPHY - 205
Explain the relationship between Ethical and Psychological Egoism? Do you think it is possible to advocate psychological egoism but not ethical egoism? As it is important to know the relationship between Psychological Egoism from Ethical Egoism, it i
Saint Louis - PHILOSOPHY - 205
ETHICS Question: In order for an action to be free and fit for praise or blame it must be based on choice. Both Aristotle and Hum claim that choice is the result of a union of desire and cognition, however, they claim that owns desires are determined
University of Texas - GOV - 312L
Gov 3/18Carter and the Politics of Reform A. Carter's political calculus Values versus power Carter and the Democrats Oil and interdependence B. North-South politics The panama canal Africa on its own terms Camp David Accord C. The Great reversal Th
University of Texas - GOV - 312L
Gov 3/27Reversal of Carters human rights policy Increased financial support for very troubled regimes3/27/2008 12:28:00 PMReagan white house never embraced apartheid in Africa Admin backed off of all Carters attemptsfirst stake of Reagans approa
University of Texas - GOV - 312L
Government 3/4/08 NotesNixon Cont'd3/4/2008 12:35:00 PMWhile Nixon clearly initiated changes, it would be a mistake to draw a black/white contrast with what came before in 50s and 60s. Many similarities Continued pursuit of containment Retrenchm
University of Texas - GOV - 312L
Government Nixon 23/5/2008 7:54:00 PMNixon's inaugural address in Jan of 69: was stunning in that it spoke of limits and constraints on America. We are approaching the limits of what government can do; torn by division and wanting unity. He reali
Illinois State - MAT - 120
Math 120 SP08 SBrodnick1.1: Functions from the Numerical and Algebraic ViewpointsChapter 1: Functions and Linear Models 1.1: Functions from the Numerical and Algebraic Viewpoints* Evaluating functions on your calculator. Enter 5x + 6 into Y1 Go
Illinois State - MAT - 120
Math 120 SP08Section 6.4 Notes: Permutations &amp; CombinationsBrodnickExample: 1. At the state track meet, 8 runners make it to their event final. If ribbons will be awarded for each place, how many ways can this be done? * An ordered arrangement
Illinois State - MAT - 120
Math 120 SP08Section 6.3 Notes: Addition &amp; Multiplication PrinciplesBrodnickExamples: 1. You go to a restaurant where they are serving 2 beef dishes, 3 poultry dishes, and 4 seafood dishes. You get to choose any one entre. How many choices do y
Illinois State - MAT - 120
Math 120 Spring 2008 Brodnick Lab #4: 3.3 &amp; 3.5 1. Correctly fill in the appropriate formula for the following types of problems: #1 Answer: If you are given a system of equations, and you're asked to solve the system using matrix inversion, you'd us