Educational Objectives: After completing this assignment, the student should be able to do the following:
Operational Objectives: Submit documentation that you can use Emacs, modify your aliases, and create/use Unix scripts.
Deliverables: One file: report1.txt
This assignment consists of a sequence of steps performed with a Unix login session. To document your completion of these steps, copy/paste the screen results into a file named report1.txt through emacs. Then submit the assignment using the submit script process.
Basic Documents. Find these documents using the course organizer:
Establish your Course Portfolio by completeing Assignment 0.
Organize Account. Log in to your CS account. In your home directory, create a directory named cop3330. From within this directory, create a subdirectory named hw1. Complete the rest of this assignment inside this subdirectory.
Set up Emacs. (This is part of Assignment 0, repeated here in case you missed it.) Log into your account on shell and copy some Emacs setup files that will make Emacs behave reasonably with respect to your keyboard:
cp ~cop3330p/emacs_dot_files/.emacs ~/ cp -r ~cop3330p/emacs_dot_files/.lisp/ ~/
These files are publicly readable, so no group membership is required to copy them.
Begin Report. Use Emacs to create a text file named report1.txt. Type the following information at the top of this file:
COP 3330 Spring 2015 Homework Assignment 1.1 (Your Name) CS Username: (Your CS Username - used for login to CS account) FSU Username: (Your BB Username - used for login to Blackboard)
Save the file and exit emacs.
Unix Command Scripts. After you have completed the required portion of this assignment, you may want to learn how to create a few time-saving (and mistake-preventing) Unix command scripts.
#!/bin/sh rm $1/*.o rm $1/*.x
chmod 700 clean
clean .
Aliases. Follow the instructions in the Unix/Emacs hints to create the "e" alias for Emacs.
Finish Report. Use Emacs to re-open your file report1.txt. Open a second ssh window, and through that window get into your hw1 directory. Then issue these Unix commands:
ls -l ~/cop3330/hw1/ ls -l ~/.bin more ~/.alias more ~/.emacs ls -l ~/.lispUsing your mouse, copy the results of each of these commands into your report (via the Emacs session in your other ssh window). Then save your report and exit Emacs. Now close out the second ssh window.
Submit Project. Submit the report using the assignment submit system:
Checking CS Email. It is important that you check your CS Email regularly - at least daily. This is the system that is used by the department for all sorts of important stuff, including messages from the Department Chair, messages from the advising staff, messages from the local chapter of ACM, and ... email on assignments in this class. There are three ways to check your CS Email.
Educational Objectives: After completing this assignment, the student should be able to do the following:
Operational Objectives: Create your CS account and submit documentation that you can create, build, and run multifile programs using Unix, Emacs, g++ and Make.
Deliverables: Use the command submit.sh deliverables2.sh to turn in the following files: makefile, main.cpp, machine.h, machine.cpp, user.h, user.cpp, report2.txt.
This assignment consists of a sequence of steps performed with a Unix/Linux login session. To document your completion of these steps, copy/paste the screen results into a file named report2.txt through emacs. Then submit the asignment using the submit script process.
Re-use directory. Work in the directory cop3330/hw1 that you created for the first part of the assignment.
Begin Report. Use Emacs to create a text file named report2.txt. Type the following information at the top of this file:
COP 3330 Spring 2015 Homework Assignment 1.2 (Your Name) CS Username: (Your CS Username - used for login to CS account) FSU Username: (Your ACNS Username - used for login to Blackboard)
Get Project Files. Copy all of the files in ~cop3330p/LIB/hw1/ into the hw1 directory by entering the command:
cp ~cop3330p/LIB/hw1/* .
Note that there are five C++ code files now in your directory: two header files and three implementation files. Use Emacs to examine each of these files. Note the #include<> statements referring to other files in the directory. Describe the header file contents and the implementation file contents. (Put the description in your report.)
Learn what the servers are and what they are for. Look on the system web site and find out which CS servers are available to you and what they are used for. In particular:
Compile Project. Log in to one of the linprog machines and issue the following sequence of commands:
g++47 -c -Wall -Wextra -I. user.cpp g++47 -c -Wall -Wextra -I. machine.cpp g++47 -c -Wall -Wextra -I. main.cpp g++47 -osoda.x main.o machine.o user.o(Note that g++ and make are not available on shell. You need to log in to linprog or program to access these tools.) Note that these commands compile three implementation files to object code, and then create an executable named "soda.x". Use ls -l to verify that you have the object code files and the executable. Now run the executable (by entering its name). Explore enough to be able to describe this simulation, and write your description in the report.
Access the online man pages for g++ and enter in your report the function of each of the flags -c, -Wall, -Wextra, -I, and -o. Which of these takes an argument, and what is the argument used above? (Explain.)
Before beginning the next step, erase the object and executable files, using your "clean" script created in homework 1.1.
It is advisable not to type the rm command with the '*' character anywhere - it carries out what you type without mercy. Many people have lost a lot of files being careless with rm.
Create a Makefile. Now use the utility named make to simplify the compilation process for this project. Make is a program running on the Unix machines designed to read a file of compile commands (or other shell commands) and create and keep various targets up to date. The file read by make is called a makefile. The default name for a makefile is "makefile".
# makefile for soda machine project # # COP 3330 Assignment 1 # (your name) #Note the use of '#' to indicate comments.
... # (your name) # <TAB> g++47 -c -Wall -Wextra -I. user.cpp <TAB> g++47 -c -Wall -Wextra -I. machine.cpp <TAB> g++47 -c -Wall -Wextra -I. main.cpp <TAB> g++47 -osoda.x main.o machine.o user.o
... machine.o: machine.h machine.cpp <TAB> g++47 -c -Wall -Wextra -I. machine.cpp ...The depency list is determined by the #include<> statements in the code file being compiled. (Don't include library files in the dependency list, just the files that are specific to the project.)
program1[~/cop3330/hw1]>make soda.x g++47 -c -Wall -Wextra -I. main.cpp g++47 -c -Wall -Wextra -I. user.cpp g++47 -c -Wall -Wextra -I. machine.cpp g++47 -o soda.x main.o user.o machine.o program1[~/cop3330/hw1]>and a check should show that the project has been completely compiled.
Complete Report. Make sure that all steps in this assignment are documented in the report file report2.txt. When a question is asked, answer it in writing in the report. To document a sequence of commands, open the report with Emacs in another window and copy/paste screen output into the report.
Submit Project. Submit the makefile, source code, and report using the project submit system:
Warning: Submit scripts do not work on the program and linprog servers. Use shell to submit projects.
After submission, take the quiz HQ1 in Blackboard. This quiz covers these resources:
Note that the quiz may be taken several times. The highest of the grades will be recorded and count as 20 points (40 percent of the assignment).