Starting from:

$29.99

IPC144 Workshop #1 Solution

Topic(s)
• A Simple C Program implementing standard output
• Using Visual Studio’s Integrated Development Environment (IDE)
• Using PuTTy – a client application supporting the Secured Socket Shell network Protocol (SSH) to interact with a Linux server
• Using WinSCP or FileZilla client application supporting the Secured File Transfer Protocol (SFTP) to copy files to a remote Linux server

Learning Outcomes
Upon successful completion of this workshop, you will have demonstrated the abilities:
• to use Visual Studio to code, edit and execute a C-language program
• to login to a remote host using SSH client application
• to transfer source code files between a local computer and a remote host using an SFTP client application


Submission Policy

All files you create or modify MUST contain the following 4 pieces of information; your:
1. Full name
2. Student Number
4. Section Information Code
Notes
• You are responsible for backing up your work regularly

If any Part-1, Part-2, or Reflection portions are missing, the mark will be ZERO.


Part-1 (10%)
Instructions
Create a C program that displays to the standard output (screen):
Note: this should display on a separate line. Only the part between > and < and highlighted in yellow are to be printed. The yellow is just to highlight the text to be printed, you do not print in yellow.

Code your program on your local computer:
• Select “Create a new project” from the splash screen:

• Type “Empty Project” in the new project filter:

• Select the C++ template with Windows and Console on the lower line:

• Click the NEXT button
• Enter “Workshop1” as the Project Name
• Set the Location where you want to save the project (use the button with the ellipsis “…” to specify a different path from the default) o Note: If you are using a public computer, it is strongly advised you use a USB removable/flash drive
• Click the button: “Create”
• From the top menu bar, select Project -> Add New Item
• Select “Code” under the “Visual C++” tree (left panel)
• Select “C++ File (.cpp)” (right panel)
• Enter “w1p1.c” as the File Name (bottom panel)
o Note: Make sure the file extension is ALWAYS “.c” (This forces Visual Studio to use the C compiler)
• Click the button “Add”
• Enter your source code in the main window (the contents of file “w1p1.c”)
• Compile your code: From the top menu bar, select Build -> Build Solution o If there are errors, fix your errors and re-attempt building
(keyboard shortcut: <CTRL> + <Shift> + B)
• If successful (bottom left corner status message), execute your program: From the top menu bar, select Debug -> Start without Debugging (keyboard shortcut: <CTRL> + F5)

Remote Linux System (matrix)
Prepare your matrix environment for this course and for submitting your workshops:
• Open an SSH client application like PuTTy
• Connect to the host: matrix.senecac.on.ca ||OR|| matrix.senecacollege.ca
• Create a directory named ipc144 where all your workshops will be stored and change into that directory:
[… ~]$ mkdir ipc144 <ENTER>
[… ~]$ cd ipc144 <ENTER>
• Create another directory inside ipc144 called “w01” to store workshop #1 files:
[… ipc144]$ mkdir w01 <ENTER>
[… ipc144]$ cd w01 <ENTER>
• Remain connected to matrix and leave this application open

Copying your source code file to matrix:
• Open an SFTP client application like WinSCP or FileZilla
• Connect to the host: matrix.senecac.on.ca ||OR|| matrix.senecacollege.ca
• Transfer your source file “w1p1.c” from your local computer to the remote matrix directory w01 that is inside directory ipc144 (~/ipc144/w01) o Avoid unexpected errors; ensure your transfer mode is set to “Text” (NOT Auto):


Test your code on matrix:
• Return to your SSH client application (PuTTy)
• Be sure your current directory is the w01 directory (inside ipc144)
• Confirm your transferred file exists in this directory by listing the contents:
[… w01]$ ls <ENTER>
• Compile and run your solution on matrix:
[… w01]$ gcc -Wall w1p1.c -o w1 <ENTER>
[… w01]$ w1 <ENTER>
• Make sure the output is EXACTLY as the sample output illustrates earlier in this workshop






Part-1 Submission
1. Upload (file transfer) your source file “w1p1.c” to your matrix account
2. Login to matrix in an SSH terminal and change directory to where you placed your workshop source code.
3. Manually compile and run your program to make sure everything works properly:
gcc -Wall w1p1.c -o w1 <ENTER>
If there are no error/warnings are generated, execute it: w1 <ENTER>
~profName.proflastname/submit 144w1/NAA_p1 <ENTER>
5. Follow the on-screen submission instructions



Part-2 (40%)
Instructions
Upgrade your Part-1 program to display the following:
+-------------------------------+
| Introduction to C Programming |
+-------------------------------+
Program written by:
Your_Full_Name

• Substitute the highlighted yellow section with your full name
• Save your upgraded code to a file named “w1p2.c”




Reflection (50%)
Instructions
• Create a text file named “reflect.txt”
• In 3-4 sentences describe in your own words:
1. What you have learned in completing this workshop
2. Briefly describe what SSH is and how you used it in this workshop
3. Briefly describe what SFTP is and how you used it in this workshop







Part-2 Submission
1. Upload your source file “w1p2.c” to your matrix account
2. Upload your reflection file “reflect.txt” to your matrix account (to the same directory)
3. Login to matrix in an SSH terminal and change directory to where you placed your workshop source code.
4. Manually compile and run your program to make sure everything works properly:
gcc -Wall w1p2.c -o w1 <ENTER>
If there are no error/warnings are generated, execute it: w1 <ENTER>
~profName.proflastname/submit 144w1/NAA_p2 <ENTER>
6. Follow the on-screen submission instructions

More products