[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] / [CSci202] / lab01
[Text Version] [Syllabus] [Schedule] [Glossary] [Resources] [Grading] [Contact] [Question] [Search ]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10]
Mon Apr 4 13:50:51 PDT 2011


    CSci202 Laboratory 01: Review: editing, compiling, testing,...

    Note: In my experience, there many things that make this harder than it looks: no account, no experience of UNIX, account shut down, forgetting things learned in CSci201, and updated operating systems and compilers.


    1. To have logged in and used our Linux Lab computers.
    2. To have found and looked at the CS202 WWW site.
    3. To have found and looked at the Computer Science Club site.
    4. To have created, compiled, and run a simple C++ program.

    Ideal Scenario

    1. If any these steps seem impossible check the Exceptions below and/or ask me for help.
    2. Login as usual.
    3. Start Firefox(or other browser). Input this URL in the location box: [ http://cse.csusb.edu/dick/cs202/ ]
    4. Try all the links at the top of the page.... where do they go?
    5. Can you find the way to this lab page?
    6. Visit the Computer Science Club [ http://cse.csusb.edu/resources/club/ ] and it's forums [ csec_sb ]
    7. Create the smallest C++ program you can think of that outputs something when run.
    8. Make your program compile. Please see Hints below.
    9. Run and test your program.
    10. Show me and get an A!
    11. Close down your browser and logout before you leave the laboratory. (IMPORTANT).


    12. Show me what you have found on the web sites. Point out an error or ask a question. Show me your program, on the screen and run it.


    13. Before the end of the laboratory period.

    . . . . . . . . . ( end of section Ideal Scenario) <<Contents | End>>


      If you don't have an account, haven't done this before, or your account has died over the spring break, tell me and get an instant extension to complete the lab during the week. When done check in to my office... you can login and demo your work there. Or else show me next week in the lab.

      1a If you haven't used our Linux before

      1. Tell me!
      2. I will figure out what to do depending how many people are new to Linux.

      2a If you don't have an account

      1. First ask me.... Ken usually gives me a list of newly created accounts.
      2. Or fill in the form asking for one.
      3. In the lab, sit with someone who does have an account.
      4. Learn by watching them, asking questions, and taking notes. You may need to study a UNIX books.
      5. Wait for your account to be created (typically 48 hours) and then do the lab.

      2b If your CSCI account doesn't work

      1. Tell me!
      2. Wait for your account to be fixed (typically 24 hours) and then do the lab.
      3. When done check in to my office... you should be able to login and demo your work there.

      3a If Firefox refuses to work because it is running elsewhere

      1. Use Konqueror for this lab.
      2. Go back to the machine where you left Firefox running and kill it. (I can help with the correct UNIX commands to kill a "zombie" process")

    . . . . . . . . . ( end of section Exceptions) <<Contents | End>>


    1. Put simple C++ programs in files that end ".cpp", for example "lab01.cpp".
    2. I strongly suggest that in these labs you use my Q command. I makes compilation and testing of lab programs very much easier -- less typing, less worrying, and it stores a copy of each compiled program ready to be used. Use it like this:
       		Q lab01.cpp
      It will compile lab01.cpp to give output lab01 and then run it as a test. The compiled program can be run at any time
      Q will also handle most languages that we have on our lab machines.

    3. Or you can compile C++ programs with the command:
       		g++ -w -I/usr/include -o name name.cpp

    4. Different people use different editors to create their source code: vi, emacs, gedit, ... Use whatever you like... and then use Q to test the code.
    5. I am an expert in using vi and can help you with it. You can integrate Q and vi by this command:
       		Q cs202
      and it also makes vi number your file.

    6. Turn on the line numbering in your editor!

    7. If you've used and like Eclipse.... that is OK ... and you can help me!


  1. accessor::=`A Function that accesses information in an object with out changing the object in any visible way". In C++ this is called a "const function". In the UML it is called a query.
  2. Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  3. class::="A description of a set of similar objects that have similar data plus the functions needed to manipulate the data".
  4. constructor::="A Function in a class that creates new objects in the class".
  5. Data_Structure::=A small data base.
  6. destructor::=`A Function that is called when an object is destroyed".
  7. Function::programming=A selfcontained and named piece of program that knows how to do something.
  8. Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  9. mutator::="A Function that changes an object".
  10. object::="A little bit of knowledge -- some data and some know how". An object is instance of a class.
  11. objects::=plural of object.
  12. OOP::="Object-Oriented Programming", Current paradigm for programming.
  13. Semantics::=Rules determining the meaning of correct statements in a language.
  14. SP::="Structured Programming", a previous paradigm for programming.
  15. STL::="The standard C++ library of classes and functions" -- also called the "Standard Template Library" because many of the classes and functions will work with any kind of data.
  16. Syntax::=The rules determining the correctness and structure of statements in a language, grammar.
  17. Q::software="A program I wrote to make software easier to develop",
  18. TBA::="To Be Announced", something I should do.
  19. TBD::="To Be Done", something you have to do.
  20. UML::="Unified Modeling Language".
  21. void::C++Keyword="Indicates a function that has no return".