DOC PREVIEW
UMD CMSC 132 - Object-Oriented Programming II

This preview shows page 1-2-3-4-5-6 out of 18 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CMSC 132: Object-Oriented Programming IINelson Padua-PerezWilliam PughDepartment of Computer ScienceUniversity of Maryland, College Park2BitSet ClassImplements a vector of bits where the bits of the set are indexed by nonnegative integersMethodsBitSet() – New bit setBitSet(int nbits) – Bit set large enough to represent bits with indices from 0 through nbits – 1and(BitSet set) – Performs logical and between the current object and the set parameter (current object is updated with the result)or(BitSet set) – Performs logical or between the current object and the set parameter (current object is updated with the result)cardinality() – Returns number of bits set to 1flip(int bitIndex) – Sets the bit at the specified indexget(int bitIndex) – Returns true if the bit at bitIndex is set; false otherwiselength() – Index of the highest set bit + 1. It returns zero if the BitSet contains no bits set. size() – Number of bits space used by the BitSet to represent bit valuestoString() – For every bit set, the decimal representation of that index is included in the result.Example (See Computers.java)3Project #1CVS repository informationHost: linuxlab.csic.umd.eduRepository Path: /afs/csic.umd.edu/users/pugh/cs132/cs132XXXwhere cs132XXX is your linuxlab account which you can find through grades.cs.umd.eduDemo of playing the gameBrief overview of what students are expected to implementAsk students to go over the open policy available on the class web site4Two-Dimensional Arrays of PrimitivesEach row in a two-dimensional array is an arrayThe rows can have different lengthsDefining a primitive array where rows have the same lengthint [ ][ ] data = new int[3][4];Defining a primitive data array where rows have different lengths (ragged array)int [ ][ ] ragged = new int[2][];ragged[0] = new int[3];ragged[1] = new int[1];5Two-Dimensional Arrays of ObjectsEach row in a two-dimensional array is an arrayThe rows can have different lengthsDefining an array where rows have the same lengthString [ ][ ] data = new String[3][4];Important: Keep in mind we have created a two-dimensional array of references to String objects. No String object is present yet. We can also have ragged arraysExample (See Roster.java)6Modern Software DevelopmentWhy do we want to study the software development process?To understandSoftware development problemsWhy software projects failImpact of software failures How to develop better softwareSoftware Engineering (from Wikipedia)Field that creates and maintains software applications byapplying technologies and practices from computerscience, project management, engineering, applicationdomains, and other fields.7Software Development ProblemsSoftware is expensiveCost per line of code increasing(while hardware costs drop)Software is late (schedule overruns)Software cost more (cost overruns)Software is difficult to useSoftware is difficult to understandSoftware is missing featuresSoftware is too slow8Software Projects FailAnywhere from 25-50% of custom software failLatest exampleJan 13, 2005, LA Times “A new FBI computer program designed to help agents share information to ward off terrorist attacks may have to be scrapped, forcing a further delay in a four-year, half-billion-dollar overhaul of its antiquated computer system… Sources said about $100 million would be essentially lost if the FBI were to scrap the software…”9Software Contributing to Real Failures1990 AT&T long distance calls fail for 9 hoursWrong location for C break statement 1996 Ariane rocket explodes on launchOverflow converting 64-bit float to 16-bit integer1999 Mars Climate Orbiter crashes on MarsMissing conversion of English units to metric units10Impact of Software Failures IncreasingSoftware becoming part of basic infrastructureSoftware in cars, appliancesBusiness transactions moving onlineComputers becoming increasingly connectedFailures can propagate through internetInternet wormsFailures can be exploited by othersVirusesSpyware11Why Is Software So Difficult?ComplexitySoftware becoming much largerMillions of line of codeHundreds of developersMany more interacting piecesLength of useSoftware stays in use longerFeatures & requirements changeData sets increaseCan outlast its creators12Software SizeSmall1-2 programmers, < 3000 lines of codeMedium2-5 programmers, < 20,000 lines of codeLarge5-20 programmers, < 100,000 lines of codeVery large20-200 programmers, < 1 million lines of codeExtremely large> 200 programmers, > 1 million lines of code13SLOCSLOC – Source lines of code (SLOC)Software metric that measures the amount of code in a programAccording to Gary McGraw:Win 95 – 15 Millions SLOCWin 98 – 18 Millions SLOCWin XP – 40 Millions SLOC14Software SizeSmall software projectsCan keep track of details in headLast for short periodsWhat students learn in schoolLarge projectsMuch more complexCommonly found in real worldWhy we try to teach youSoftware engineeringObject-oriented programming15Software Life CycleCoding is only part of software developmentSoftware engineering requiresPreparation before writing codeFollow-up work after coding is completeSoftware life cycleCertain essential operations needed for good software developmentNo universal agreement, just general agreement16Components of Software Life Cycle1.Problem specification2.Program design3.Algorithms and data structures4.Coding and debugging5.Testing and verification6.Documentation and support7.Maintenance17“Waterfall Model” of Life CycleSimple modelProceed from one step to nextResult of step flow into nextIn realityMay need to return to previous step Steps may be more integratedSteps may occur at same time18Software Life CycleWaterfall modelReasonable for small projectsUnworkable for large projectsSome alternative approaches“Unified model”Iteratively add incremental improvements“Extreme programming”Write test cases before writing code“Rapid prototyping”Use working prototypes to refine


View Full Document

UMD CMSC 132 - Object-Oriented Programming II

Documents in this Course
Notes

Notes

8 pages

Recursion

Recursion

12 pages

Sorting

Sorting

31 pages

HTML

HTML

7 pages

Trees

Trees

19 pages

HTML

HTML

18 pages

Trees

Trees

19 pages

Honors

Honors

19 pages

Lecture 1

Lecture 1

11 pages

Quiz #3

Quiz #3

2 pages

Hashing

Hashing

21 pages

Load more
Download Object-Oriented Programming II
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Object-Oriented Programming II and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Object-Oriented Programming II 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?