Notes
Slide Show
Outline
1
"Brad Rippe"
  • Brad Rippe
2
Course Information
  • Contact Info
  • Course Requirements
  • Course Grading
  • Hardware and Software


3
Welcome to the course
  • Brad Rippe
  • Email – brippe@fullcoll.edu
    • If you email please add CSCI123 to the subject line
  • Phone – (714) 992 – 7516
  • Office – T7B (caddy corner to what was staff parking lot B) – Moving to 3100 mid Sept
  • I work in Academic  Computing on campus
4
Syllabus
5
The Book
  • Do I need the book?
    • You should purchase the book or a version of the book.


  • Problem Solving with C++
  •  7th Edition


  • By:   Walter Savitch
  • Publisher: Addison-Wesley



6
What’s Expected?
  • Prerequisites:
    Math 142 (Trigonometry) or three years of high school mathematics including trigonometry with grades of "C" or better.


7
Grading
8
Grading Scale
9
Calculating Grade
  • [Your points]/[Total points] * [Weight]


  • 90/100 * .60 = .54
  • 10/10 * .20 = .20
  • 5/10 * .10   = .05
  • lab             = .05
  • hw = .05
  • Total = 89%


10
Your responsibilities
  • Student Wait Time for Late Instructors
  • Academic Honesty
  • ADA – if you have specific need for assistance, please notify your instructor
11
Course Schedule
  • Brief outline in the handout
  • Check the course web site
    • Assignments
    • Lectures
    • Handouts


  • http://staffwww.fullcoll.edu/brippe/csci123


12
What are we doing?
13
The Development Environments
  • Popular IDEs/Compilers
    • Microsoft’s  Visual C++ 2008 Express Edition
      • http://www.microsoft.com/express/download/
    • Microsoft’s  Visual C++ 2005 Express Edition
      • http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
    • GNU’s  g++  with a text editor of choice
      • http://gcc.gnu.org/
    • Borland’s C++ builder
      • http://www.codegear.com/tabid/123/Default.aspx
    • MinGW
      • http://www.mingw.org/
    • Dev-C++ (BloodShed)
      • http://www.bloodshed.net/dev/devcpp.html



14
What environment will we use?
  • We will use the linux operating system with the GNU g++ compiler.
  • You can use any editor you like
    • linux provides nano, vim, emacs
  • You must compile your programs and execute them on the fccsci.fullcoll.edu server to receive full credit


15
Text Editors
  • Windows Editors
  • Vim
    • http://www.vim.org/
  • Notepad++
    • http://notepad-plus.sourceforge.net/uk/site.htm
  • Linux Editors
  • Nano
    • http://www.nano-editor.org/
  • Vim
    • http://www.vim.org/download.php
16
"Brad Rippe"
  • Brad Rippe
17
Hardware (computer systems)
  • PC  (Personal Computer)





  • Workstation





  • Mainframe
18
Network
19
Common Components
20
Computer Memory
  • Main Memory
    • Scratch Paper
      • Temporary



  • Secondary Memory
    • Disk Drives, USB Drives
      • Extended life
21
Main Memory
  • Random Access
    Memory
    (RAM)
    • Bit – binary digit
    • Byte – eight bits
    • Address
22
The Computers Brain
  • CPU
    • Basic instructions
      • Add
      • Subtract
      • Multiply
      • Divide
      • Move things
23
Software
  • Operating System
    • DOS, Windows, Linux, Unix, VMS, MacOS, and more…


  • Applications
    • Console, Web Browser, Office Suite, Email Client, Utilities, and much much more…
24
Programs/Applications
25
Languages
26
High Level Languages
  • Examples
    • C/C++
    • Java
    • C#
    • Visual Basic
  • Look similar to English
  • Easier to write than low level language
  • Must be translated or interpreted into low level language by the compiler
  • Abstracted from the computer hardware
27
Low-Level Languages
  • Close to the hardware
  • Assembly Language
    • Abstract machine language one level
    • Easier to write than Machine language




  • Machine Language
    • CPU understands
    • 100011 00011 01000 00000 00001 000100
28
Compilers
  • Program which
  •      takes your source
    code and translates
    it into machine
    code
  • Computer
    understands the
    machine code and
    can execute it
    on the platform
29
Linker
  • Run after the compiler
  • Combines your object code
    with any of the pre-existing
    object code
    (input and output)
  • generates a complete
    program


30
Algorithms
  • Sequential steps for solving a problem or task
  • Language independent
  • Written in plain English
  • Allows programmers to concentrate on the solution without worrying about the implementation details


31
Cake Algorithms
  • Stir into a large mixing bowl
    • 2 eggs
    • 4cups of water
    • Cake mix
  • Once all the lumps are gone
    • Preheat oven to 400 degrees
    • Place cake mix in a 4X7 greased cake pan
    • Bake for  35 minutes
    • Cool for 15 minutes and serve
32
Simple Sort Algorithm
  • Get a list of unsorted numbers
  • Repeat steps 3 through 6 until the unsorted list is empty
  •  Compare the unsorted numbers
  •  Select the smallest unsorted number
  •  Move this number to the sorted list
  •  Remove the selected smallest number from the unsorted list
  • Stop


33
Simple Sort Algorithm
34
Simple Sort Algorithm
35
Simple Sort Algorithm
36
Simple Sort Algorithm
37
Simple Sort Algorithm
38
Simple Sort Algorithm
39
Simple Sort Algorithm
40
Simple Sort Algorithm
41
Program Design
  • Problem Solving Phase
    • Algorithm is design
    • Algorithm is tested


  • Implementation Phase
    • Algorithm is translated
      into C++
42
Object Oriented Programming
  • Objects are designed to simulate real world items
  • Objects have characteristics and actions
  • Not specific to C++
  • C#, PHP, Python, Java and more
  • Main Characteristics
    • Encapsulation
    • Inheritance
    • Polymorphism
43
Software Life Cycle
(Common)
  • Analysis and specification of the software
  • Design of the software
  • Implementation
  • Testing
  • Maintenance and evolution of the software
  • Retirement


  • Others
    • Waterfall Model
    • Spiral Model
    • Iterative Model

44
Intro to C++
  • Derived from C
  • Developed at AT&T Bell Laboratories by Bjarne Stroustrup in the 80’s
  • Overcome some of the shortcomings of C
  • Object Oriented was the one of the main features of the language
45
Sample C++ Programs
  • #include <iostream>
  • using namespace std;


  • int main() {
  • return 0;
  • }
46
Sample C++ Programs
  • #include <iostream>
  • using namespace std;


  • int main() {
  • cout << “Sending text to the screen.\n”;
  • return 0;
  • }


  • cout – sends output to the monitor
  • “\n” – sends the cursor to the next line (newline)
  • return 0; - terminates the program
  • <<  - insertion operator


47
Sample C++ Programs
  • #include <iostream>
  • using namespace std;


  • int main() {
  • int someInteger = 0;
  • cout << “Declaring variables. Type a number.\n”;
  • cin >> someInteger;
  • cout << “Here’s your number “;
  •   cout << someInteger;
  • cout << endl;
  • return 0;
  • }


  • cin – sends input from the keyboard to a variable
  • endl – sends the cursor to the next line (newline)
48
Simple C++ Program Layout
  • #include <iostream>
  • using namespace std;


  • int main() {


  • variableDeclarations
  • ...
  • statement1
  • statement2
  • ...
  • return 0;
  • }
49
Compiling and Running
  • C++ source code is text.
  • It can be written with
    any text editor:
    • VIM
    • EMACS
    • Nano
    • More…

  • This is old school and
    still cool!!!


50
Compile from Command line
  • G++ Compiler
    • g++ -Wall hello.cpp -o hello
    • Run by typing:
      • ./hello

  • Visual Studio Command line
    • Cl –nologo –Ehsc –GR –Zc:forScope –Zc:wcar_t –Fohello hello.cpp
51
Bugs
52
Resources
  • Course Web Site
    • http://staffwww.fullcoll.edu/brippe/csci123
  • Course Style Guide
    • http://staffwww.fullcoll.edu/brippe/csci123/style.aspx
  • Course Syllabus
    • http://staffwww.fullcoll.edu/brippe/csci123/syllabus.aspx
  • Course Schedule (tentative)
    • http://staffwww.fullcoll.edu/brippe/csci123/schedule.aspx