CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with Linux, vi, subscription
Basic Programming What does a C++ program look like How do you use your computer account
Linux Use your user name and password to log into emerald Use passwd command to change your password
4 Processing a Program t Editor used to enter the program –Source program (file.cpp) –UNIX vi text editor t Compiler translates the source program –Displays syntax errors (not descriptive) t Linker/Loader to combine object file with other object files –Executable program
5 Processing a Program t Major activities –Editing - vi or other text editor vi hello.cpp –Compiling/Linking - one step with g++ on emerald g++ hello.cpp g++ -o hello hello.cpp –Running - type the executable name a.out hello
shell.cpp /* shell.cpp */ #include int main( void) { cout << "The first line of text" << endl; return 0; }
input and output I/O in C++ uses streams cout << "some text" << endl; cin >> someVar;
Program output cout is standard output stream –monitor << is an operator that inserts data into an output stream –outStream << data Text in double quotes is a constant string –“Hello, World!”
Program input cin is standard input stream –keyboard >> is an operator that extracts data from an input stream –inStream >> variable
Software Development Method t Problem Analysis - (Correct Problem) –Identify data objects –Goal to model properties –Determine Input / Output data –Constraints on the problem t Design –Decompose into smaller problems –Top-down design (divide and conquer) –Develop Algorithm (Desk check)
11 Software Development Method t Implementation –Writing the algorithm t Testing –Verify the program meets requirements –System and Unit test t Documentation –Key part in the development process
12 Software Development Method t Software engineering –Area of computer science concerned with building large software systems t Challenge –Tremendous advances in hardware have not been accompanied by comparable advances in software