CSCE 2014 - Laboratory Assignment 1

    The purpose of this lab is to get students started using the CSCE computers and the C++ programming environment we will be using this semester. In particular, we will start with an introduction to Mac OS X, and then we will start working with the NetBeans programming environment. Since this will be the first time using this software for most of you, our advice is to be patient and ask your lab instructor and your classmates questions when you are stuck.

  1. Getting Started
  2. Introduction to Mac OS X
  3. Mac OS X is a Unix-based operating system derived from the the NeXT operating system, which followed Steve Jobs on his return to Apple in the 90s. Even though Mac OS X is proprietary, because it is Unix-based it shares a lot of functionality with other Unix-based operating systems, such as Linux.

    A number of useful Unix commands are listed and explained below. To find out more about any Unix command, use the online manual pages provided by the system. These pages typically show the different options available, examples and list any known bugs. The following list contains some common linux commands we will be working with today:

  4. Practice with Unix Commands
  5. In this section, students will get some practice with the Unix commands listed above to create and manage folders for labs and homework in this class.

    In order to display the manual pages for these commands, you can use the "man" command.


    Open the "Terminal" application and try this for two or three of the above commands to see what these pages look like.

    Create a directory called csce2014 from inside your home directory.

    	cd ~
    	mkdir csce2014

    Create the directories called lab1, lab2, and tmp from inside csce2014.

    	cd csce2014
    	mkdir lab1
    	mkdir lab2
    	mkdir tmp

    From your home directory, list all the sub-directories inside csce2014 with their details.

    	cd ~
    	ls -al csce2014

    Copy and paste the output results of the "ls" command below.

    Use "man" to display the manual pages of the "rm" command. This time, instead of displaying the page to the screen, you can save it to a text file inside the tmp directory created above.

    	cd ~
    	man rm > csce2014/tmp/rm_manual.txt

    The "more" command will let you look at rm_manual.txt file one page at a time.

    	more csce2014/tmp/rm_manual.txt

    Make a copy of the rm_manual.txt file in the lab1 directory called new_manual.txt.

    	cd ~/csce2014
    	cp -i tmp/rm_manual.txt lab1/new_manual.txt

    Execute the "cp" command again. What happened?

    Move the rm_manual.txt file from the tmp directory to the lab1 directory.

    	mv -i tmp/rm_manual.txt lab1/

    Delete the empty directory tmp.

    	rmdir tmp

    From csce2014, use "ls" to list the details of subdirectories as well as their contents.

    	cd ~/csce2014
    	ls -Ral

    Copy and paste the output results of the "ls" command below.

  6. Introduction to NetBeans
  7. NetBeans is a popular integrated development environment (IDE) for writing and debugging programs in Java, C++, and other languages. Most IDEs have editors that are "syntax aware" and will help with indenting. They also have interfaces that let you click on compiler errors/warnings and jump directly to the incorrect code. There are also several features that assist in tracing and debugging programs. On the downside, many IDEs have dozens of menu items, so it takes a while to learn how to use them effectively.

    For this lab, go through the following steps to create and compile a simple program.

    Congratulations, you have now created your first C++ program using NetBeans! The next step is to edit the source file and compile and run the program.

    Copy and paste your program output into the text box below.

  8. Creating C++ Classes in NetBeans
  9. In this section, we will be adding a C++ class called "Student" to the "hello" project. There are several ways to do this, but we will show how NetBeans can be used to create skeleton code for the class (and save you lots of typing). `

    Copy and paste your final program output into the text box below.

  10. Submit Work
  11. This lab assignment will be submitted electronically to the TAs once you fill in the fields below and click on the "submit" button. You do NOT need to print a copy of this document to hand in.

    Your UAID number:
    Your website PASSWORD:

  12. Backup Your Work
  13. Unlike previous semesters' programming labs, this lab does not use thin clients. This means that your work is not automatically saved to Turing; rather, it resides on the hard drive of the machine you're currently using. Because these machines are re-imaged from time to time, and because you might not always use the same lab machine, it is a good idea to back up your work in another location.

    You have a couple of options for backing up your work: you could put it on a flash drive, email it to yourself, or synch it with your home folder on Turing. The last option is highly recommended.

    To transfer your files to Turing:

    If your login credentials were correct, the two middle panes should now be populated with file icons. The left pane shows the files on your lab machine, the right shows the files in your home directory on Turing. To back up your work, simply find the directory where you stored your lab work in the left pane, and drag-n-drop it to the appropriate directory in the right pane.