DOC PREVIEW
GSU CSC 2320 - Chapter 1

This preview shows page 1-2-17-18-19-35-36 out of 36 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 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 36 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 36 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 36 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 36 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 36 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 36 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Data Structure IntroductionSoftware DevelopmentSoftware Development PhasesSoftware Development ModelWaterfall ModelRealistic Waterfall ModelSlide 7Problem Analysis and SpecificationTask ExampleTask AnalysisSlide 11DesignTop-down designOne level partitionTwo level partitionThree level partitionOOD:Object-Oriented DesignProgram=Algorithm + Data StructureSlide 19CodingSlide 21Testing, Execution, and DebuggingThe "V" Life Cycle ModelTwo major types of testingSlide 25Slide 26MaintenanceChapter 1 Arrays, Pointers, and StructuresOutline1.1 What are Arrays, Pointers, and Structures?1.2 Arrays and StringsVectorsSlide 33How to do Vector’s resizeVector exampleStringsData Structure Introduction Dr. Bernard Chen Ph.D.University of Central ArkansasSpring 2009Software DevelopmentHardware: actual physical components (such as CPU, memory, hard drive…)Software: refers to programs used to control the operation of the hardware.Software Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceSoftware Development ModelOne of the earliest strategies for development software is known as the Waterfall ModelWaterfall ModelRealistic Waterfall ModelSoftware Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceProblem Analysis and SpecificationProblem Analysis and Specification: The problem is analyzed and a specification for the problem is formulatedFor example: if we obtain a job request looks like:Task ExampleBecause of new government regulations, we must keep more accurate record of all students currently receiving financial aid and submit regular report to FFAO (Federal Financial Aid Office). Could we get the computer to do this for us???Task AnalysisPurposePre-condition (input): describe the state of processing before the program is executedPost-condition (output): describe the state of processing after the program is executedSoftware Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceDesignDesign: A plan for solving the problem is formulatedVarious design methods have been developed, two of major designs we describe here: top-down design and object-oriented designTop-down designThe original problem is partitioned into simpler sub-problemsFor example, the problem we just had can be obviously divided into:1. Get the student records2. Process the records3. Prepare the reportsOne level partitionTwo level partitionThree level partitionOOD:Object-Oriented DesignIdentify the objects in the problem's specification and their types.Identify the operations or tasks to manipulate the objectsProgram=Algorithm + Data StructureAlgorithm: “a step by step procedure for solving a problem or accomplishing some end”In computer science, algorithm must be:1. Definite, unambiguous2. Simple3. FiniteSoftware Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceCodingThere’s not much we can talk in coding, you all know what it is. After you select the language, three major principles you need to follow:1. Programs and Subprograms should be well structured2. All source code should be documented3. It should be formatted in a style that enhances its readabilitySoftware Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceTesting, Execution, and DebuggingErrors happen all the time!!!There are three different points at which errors can be introduced:1. Syntax errors2. Run-time errors3. Logic errorsThe "V" Life Cycle ModelTwo major types of testingBlack box testing:Outputs produced for various inputsChecked for correctness Do not consider structure of program component itself.(so basically, it just test a lot of different inputs and match with the expected outputs )Two major types of testingWhite box testing:examine code’s internal structure(Test for every loop, if statement, functions…)Test data is carefully selectedSoftware Development PhasesProblem Analysis and SpecificationDesignCodingTesting, Execution, and DebuggingMaintenanceMaintenanceAfter the software has been used for several years, they will require modificationsStudies show that a higher percentage of computing budgets and programmer time are devoted to software maintenance1970s 35-40%1980s 40-60%1990s 70-80%2000s 80-90%Chapter 1 Arrays, Pointers, and Structures Dr. Bernard Chen Ph.D.University of Central ArkansasSpring 2009OutlineArrays (first-class arrays, using vector)Strings (using string)PointersDynamic allocationReference variables and parameter passing mechanismsStructures1.1 What are Arrays, Pointers, and Structures?Aggregate: collection of objects stored in one unit Arrays: indexed collections of identical-type objects. (aggregate)Pointers: objects are used to access other objects.Structures: collections of objects that need not be of the same type. (aggregate)1.2 Arrays and StringsArrays: indexed collections of identical-type objects.Array always start on 0Arrays can be used in two different ways: primitive arrays and vectors.Vectors vs. Primitive ArraysVector has variable size and supports many manipulation functionsPrimitive Array has fixed size, and support only a few of manipulation functions.Vectors#include <vector>Declaration: vector<type> identifiers(size); Example: vector<int> a(3);Vector can be indexed as an array, using [ ]VectorsVector member functions: vector<int> v(10);v.at() // equal to v[ ]v.size() // return the number of elements in v v.front() // return the first element in v v.back() // return the last element in vv.clear() // delete all the element in vv.empty() // return 1 if v is empty; else return 0v.resize( val ) // change size of v to val v.pop_back() // remove the last element in vv.push_back( val ) // appends val to the end of vv.capacity() // return the number of element that vector can hold before it will need to allocate more spaceHow to do Vector’s resizeExample: vector<int> arr(10); arr.resize(12);Vector example#include


View Full Document

GSU CSC 2320 - Chapter 1

Download Chapter 1
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 Chapter 1 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 Chapter 1 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?