CS1C Saddleback College Class Logistics Enrolled or Need APC code CS1C Advanced Programming in C Logging on to Computer Science Server Class Overview and CS1B Review Part 1 http cs saddleback edu id email saddleback edu and password last 4 of SSN 00 print groups created automatically after 15 minutes need to stop at first page and read printing policies and sign up for labs 2 3 hr lab sessions are needed for this class don t need to go to the lab at this time but can t overlap another classes main purpose is for transfer Class materials are at http cs saddleback edu jtateyama cs1c you can print anything from cs saddleback edu otherwise it is restricted Shinkwrap Chapter 1 Breaks at first break go to lab and navigate to class materials to print syllabus if any problems with printing let me know Emergency fire other 2 2 CS1C Saddleback College CS1C Saddleback College Eclipse Eclipse A Universal Platform for Development Tools Terminology Choose Perspective Here Open extensible architecture based on plug ins Open source see the Eclipse Project at Eclipse org Menu bar Multi platform multi language multi vendor Tool bar Endorsed by major tool vendors Resize button Stacked view Reduced Complexity through customizable perspectives and views Ant view Support for popular features through open standards Package Explorer view Plug in development environment PDE C development tools CDT Eclipse Platform Platform Standard Java2 Virtual Machine Java VM Outline view Editor Window Stacked view Drag Drop views anywhere Editor Status Area 3 3 4 4 CS1C Saddleback College CS1C Saddleback College Specifying Workspace What is a Workspace Workspace The workspace contains user defined data projects and resources such as folders and files The space to save all user metadata code scripts database objects configuration Implemented on the file system Can not be nested Can be shared but NOT in this class User works in exactly one workspace at a certain point of time Set when starting the environment Eclipse prompts for a workspace location at the startup time The prompt could be turned off Resources Collective term for the projects folders and files that you created in a workspace Typically viewed in a hierarchical format and can be opened for editing There are three basic types of resources that exist in the Workbench Files Folders and Projects 6 5 6 CS1C Saddleback College CS1C Saddleback College What is the difference between views perspectives What is a project Project View A logical storage concept used to store related user metadata A visual tool providing defined functionality that can be placed on the user interface Assigned to one workspace Implemented as a directory in a workspace Examples Can be shared when using shared repositories Project Explorer Problems Outline Console Property etc User can work in any number of projects at the same time Perspective Can be dynamically opened and closed Saved configuration of views editors and menus typically used to realize specific activities Examples C Java Data Modeling Debug etc Only one perspective can be active Any number of perspectives can be defined User can change perspectives 7 Window Open Perspective 7 8 8 CS1C Saddleback College CS1C Saddleback College Resources C Perspective C Perspective Project Explorer View Eclipse Web Tools Platform Developing Java tm Web Applications Editor View Lawrence Mandel Arthur Ryman Naci Dai ISBN 9780321396853 Good introduction to eclipse and Web Application Development Eclipse C C Development Tooling CDT http www eclipse org cdt Console View 9 10 9 CS1C Saddleback College CS1C Saddleback College CS1B Review CS1B Review 2 Types of Identifiers Matters of Style refer to CS1B Lecture page at http cs saddleback edu michele Teaching CS1B LectureNotes html You must have style Why Points will be taken off and the following Readability Reusability Modularity Debugging Programming Language Consists of A set of special words symbols and rules to construct a program Syntax rules that dictate how valid instructions are written Ex enum Variables Constants Use value can change while a program is running value always remains the same while a program is running Purpose allows data to be stored in computer memory allows programs to be easily modified Compilation Time Compilation time Runtime Compilation Time Memory Allocation determined at Name IDENT IDENT Semantics rules that dictate the meaning attached to the instructions Value Assigned 11 12 CS1C Saddleback College CS1C Saddleback College Function Basics Function Basics Continued Two types of parameters are used with functions All Functions must have a return datatype Value Parameters main function return type is int A formal parameter that receives a copy of the contents of the corresponding argument the actual parameter Advantages no accidental modifications of arguments Disadvantages Overhead both memory and CPU other functions return may return other datatypes some functions don t return anything so use void Syntax Reference Parameter A formal parameter that receives the address location in memory of the corresponding argument the actual parameter Advantages and disadvantages are the opposite of above returnType funcName type parmName statements To avoid the disadvantages use Constant Reference return value 13 14 returntype funcName const parmType parmName 13 CS1C Saddleback College CS1C Saddleback College Function Basics Guidelines Enumeration Types PASS BY REFERENCE WHEN C allows the user to define a new simple data type by listing the literal values that make up the type This listing is referred to as an enumeration which means that each element of the type has a numeric value associated with it to allow for comparison etc Enumeration types are used primarily to add readability to a program You need to pass large variables Need low overhead If you absolutely have to change more than 1 value in a function When you need to Return Multiple Values All values passed by reference can be returned If you pass by reference and are not planning on returning a value then pass by constant reference PASS BY VALUE WHEN You need to pass simple variables literal constant or expression When you don t want the value in the calling function to be changed No side effects accidental modification of the variables Enumeration Type A user defined data type consisting of an ordered set of literal values expressed as identifiers Enumerator One of the ordered values identifiers in the list of an
View Full Document