12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 1 of 5 Detailed Instructions Each of our projects will require that you edit, compile, and run code. For this programming exercise and all...

Comp sci coding


12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 1 of 5 Detailed Instructions Each of our projects will require that you edit, compile, and run code. For this programming exercise and all others in this class, the standard compiler will be g++ on class-1.cs.georgetown.edu. To finish this assignment and the programming projects, among other skills, you must be competent at the following: • Connecting to the remote sever and logging on to your account • Editing text files on the remote server • Compiling your C++ code into something the computer can understand and run • Transferring your code to your computer so you can submit it to Canvas Step 1: Connect to the remote server. Any computer, with the proper software, can serve to edit and compile code. The problem is that different compilers operate somewhat differently which makes equitable grading of assignments difficult. We therefore require that all code for this class compiles and runs correctly on the same machine. This machine is a server that lives in a data center out in Maryland somewhere. It is named class-1.cs.georgetown.edu. To operate this computer, you will need to log in. Once logged in, you will see that the interface is a small window into which you type text commands. There is no graphical user interface (GUI). To log into this computer, you need to use a program named SSH, or secure shell. This creates an encrypted connection for you to issue commands and see output. For Windows, use the Command Prompt application. Search for cmd on your computer to find the Command Prompt App. On OS X, use the Terminal program usually found in Applications/Utilities. Your logon credentials are your netID and password. Do not be confused if nothing shows on the screen when you type your password. You will not see dots for each character, and the cursor will not advance; but the password is being entered. VERY IMPORTANT NOTE – If you are on campus using wifi, you must use SaxaNet or the server will not allow connections (this only applies on campus). When you log in, you will see a command prompt that looks something like this: [@cs-class-1 ~]$ That means you are successfully logged on and can start work. 12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 2 of 5 Step 2: Edit your program There are many editors available for creating source code files on the class server. A relatively easy one to learn and use is called nano. The Short Tutorials page on Canvas includes a demonstration of using nano. The link is titled "Edit and compile a file on cs-class server". Once logged onto the server, type: nano main.cpp This will launch the nano editor and allow you to enter program code. Next, you will create a program that, when run, simply prints out your netID followed by your name all on one line. Output for me would look like this: waw23 W. A. Woods Your source code file, like all programs in the course, will include some standard content that must appear exactly as specified. At the beginning of your file for this assignment include the following information: You may copy this content (which is a multi-line C++ comment) and paste it directly at the top of your file. Replace the text in angle brackets with the appropriate information that is specific to you. Otherwise leave the text exactly as shown above. Following the specified heading comments, you will enter your solution for the assignment. /* * main.cpp * * COSC 051 Summer 2022 * Homework #2 * * Due on: JUL 13, 2022 * Author: * * * In accordance with the class policies and Georgetown's * Honor Code, I certify that, with the exception of the * class resources and those items noted below, I have neither * given nor received any assistance on this project. * * References not otherwise commented within the program source code. * Note that you should not mention any help from the TAs, the professor, * or any code taken from the class textbooks. */ 12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 3 of 5 Step 3: Compile and run your program On the command line type the command to compile your program: g++ main.cpp If necessary, correct any errors and recompile. Run your program to verify the output. Recall that the default executable filename is a.out. The command to cause the file to run is: ./a.out Step 4: Submission Details What to submit: Submit to Canvas a .zip file containing your source code and the given Makefile. Locate the assignment Homework 2 on Canvas and attach/upload your file. Do not post your executable file. You should ensure that your source code file compiles on the server and that the executable file runs and produces the correct output. Use submit.zip as the name of the file you submit. The value for this assignment is 100 points and it is part of the Homework, etc category. Use exactly the following file names (with spelling and capitalization exactly as shown): Makefile main.cpp Due date/time: July 13th, no later than (10:00pm). Late submissions will be penalized 2.5% for each 15 minutes late. If you are over 10 hours late you may turn in the project to receive feedback but the grade will be zero. In general requests for extensions will not be considered. Creating submit.zip: Please, PLEASE, PLEASE use the provided Makefile and create your submit.zip file on the class server. If you create the compressed file on your laptop or other local computer it is highly likely something will go wrong even though it looks fine. It is easy to compress links to files, instead of actual files. It is easy to have the folder containing the project files included in the compressed file. If this, or any other problems happen; your program will not compile, automated grading programs will fail, and you will get a zero and you will not have any opportunity to resubmit. Assuming all of your files are in the same folder on the server, the process to create the submit.zip file is shown below. 12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 4 of 5 The output of this process is a file named submit.zip. You will need to transfer that file from class-1.cs.georgetown.edu to your computer. Then you will need to enter the Canvas Assignment named Homework 2 and attach/upload your file. Once your file has been uploaded to Canvas you have completed the assignment. If you subsequently make changes to your file and want to upload a new version of code that is fine with me. I will only grade the last file that has been uploaded. If you change your mind and decide a previous version is better, then you would need to upload that file again. Please note: we only want the file submit.zip. Do not upload the executable file that was created by the compiler. The "Server and Software Help" section of Canvas contains short tutorials that show how to move files between your computer and the server. I recommend that you use Filezilla. It includes an intuitive GUI and is available for Mac OS X, Windows, or Linux. If unsure always ask me for help! [waw23@cs-class-1 HW02]$ make clean rm -f *.o core a.out [waw23@cs-class-1 HW02]$ make submit rm -f submit.zip zip submit.zip main.cpp Makefile adding: main.cpp (deflated 51%) adding: Makefile (deflated 43%) [waw23@cs-class-1 HW02]$ unzip -l submit.zip Archive: submit.zip Length Date Time Name --------- ---------- ----- ---- 983 07-03-2022 03:00 main.cpp 345 07-03-2022 03:11 Makefile --------- ------- 1328 2 files [waw23@cs-class-1 HW02]$ Remove files from last compile. Create the zip file to submit. Verify the zip file contents, make sure the date and time are correct and these are the files you want to submit, you may make unlimited submissions prior to the due date, the last submission will be graded. 12 July 2022 Homework #2 (Graded) COSC 051 Summer 2022 Page 5 of 5 Grading Below is the grade rubric for this assignment. Course Materials Notice The materials used in Georgetown University courses ("Course Materials") generally represent the intellectual property of course instructors which may not be disseminated or reproduced in any form for public distribution (e.g., sale, exchange, etc.) without the written permission of
Jul 13, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here