Sale!

Create a C program that displays to the standard output

$30.00

Category:
Rate this product

Workshop #1
Part-1 (10%)
Instructions
Create a C program that displays to the standard output (screen):
>*** Welcome to Seneca’s C Programming Course ***<
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.
Visual Studio 2019
Code your program on your local computer:
• Start Visual Studio 2019 (free Community version)
• 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
• Login using your Seneca userid and password (be careful: case-sensitive)
• 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
• Login using your Seneca userid and password (be careful: case-sensitive)
• 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):

• After copying the file to matrix, you may close the SFTP application
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>
4. Run the below submission command below (replace profname.proflastname with your
professors Seneca userid and replace NAA with your section):
~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>
5. Run the below submission command below (replace profname.proflastname with your
professors Seneca userid and replace NAA with your section):
~profName.proflastname/submit 144w1/NAA_p2 <ENTER>
6. Follow the on-screen submission instructions

Reviews

There are no reviews yet.

Be the first to review “Create a C program that displays to the standard output”

Your email address will not be published. Required fields are marked *

Scroll to Top