Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 206 Lab Structured Programming in C

Similar presentations


Presentation on theme: "CSCE 206 Lab Structured Programming in C"— Presentation transcript:

1 CSCE 206 Lab Structured Programming in C
Fall 2018 Lecture 1

2 TA Ehsanul Haque Nirjhar
Office: TBA Office Hours: Tuesday 1:00 PM – 2:30 PM Wednesday 9:30 AM – 11:00 AM Lab Homepage: * You can call me Ehsan or Nirjhar, whichever you like  * s received after 8 PM will be attended on the following day

3 Peer Teachers Section 501: Christopher Comeaux, Phat Nguyen
Section 502: Christopher Comeaux, Leuel Asnake Section 503: Grant Ballard, Phat Nguyen Section 504: Nathan Brockway Details:

4 Lab Schedule Section 501: MW 04:10 pm - 05:00 pm @ RDMC 111J
Section 503: TR 03:55 pm - 04:45 RDMC 111J Section 504: TR 05:30 pm - 06:20 RDMC 111J

5 Lab Highlights Problem solving using C programming language
5 programming assignments, each consisting of 3-5 typical problems gcc complier of departmental linux server will be used for lab and assignment purpose You can use IDE like visual studio, xcode etc for learning Keep up with Professor’s lecture. Try to utilize the lab hours efficiently. Group study is helpful to share ideas about coding style and debugging techniques You must work out your lab assignments individually Google and YouTube are your best friends!!

6 Grading Rubrics Each assignment is worth 100 points. Grade distribution of each assignment will be given in the instruction. Grading Rubrics: Successful Execution: 80% Valid File Naming: 5% Developer Comments: 5% Code Indentation: 5% Well organized code and interpretable output: 5% eCampus submission Late penalty: 25% points per day Details:

7 Let’s start!

8 1st Program- “Hello, World!”
/* First program */ #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; }

9 Basic Setup – Step 1 Claiming your Computer Science account: ts *URL starting with wiki.cse.tamu.edu can not be accessed directly off campus. You need to use TAMU VPN for that. Details: N/index.php

10 Basic Setup – Step 2 Mapping your Home Directory (Already done in your lab computer, H: drive in file explorer) You have to map H: drive in your own computer for remote access. Windows: Type \\coe-fs.engr.tamu.edu\Ugrads in file explorer box Mac: Using Finder, select Go to Server. Type smb://coe-fs.engr.tamu.edu/Ugrads in the box A dialogue box will ask for authentication. Username is AUTH\your_netid and password is your TAMU password. Details: *URL starting with wiki.cse.tamu.edu can not be accessed directly off campus. You need to use TAMU VPN for that. Details:

11 1. Create a folder Create a folder named CSCE206 in your home directory Within this folder, create another folder named Lab1 Remember, no space in file name or folder name!!

12 2. Write the code Using notepad++ or sublime text (or any text editor) open a file and write the hello world code Save the file as my_code.c. Make sure that there is no space in filename. Once the file is saved, the lines should change color

13 3. Connect to Server(for Windows)
Open PuTTY and follow the instruction here under basic configuration: Use linux2.cs.tamu.edu as host name. Press Save and then press Open If you are doing this first time, a dialogue box will appear. Press Yes. Use your netid and password for access

14 3. Connect to Server(for Mac)
Open “terminal” Type ssh –l your_netid linux2.cs.tamu.edu Use your credentials to access the server

15 4. Go to proper directory You are currently in your home directory. Use linux commands “ls” and “cd directoryname” to navigate ls lists all the directories and files in your current directory (directories appear blue, files appear green). cd allows you to navigate into the directory you specify. To move back up to the parent level, use the command “cd ..” Some basic commands:

16 4. Go to proper directory Red boxes show the ls command
Blue boxes show the cd command

17 5. Compiling the code Once you are in the directory with the code file, run the command “gcc code_filename.c –o output_filename” For this case, run the command “gcc my_code.c –o my_code” If the code does not compile, it will show some error. Debug the code. If the code compiles successfully, a new file named as output_filename(my_code in this case) will be created. Use ls command to check Run “./output_filename” command to compile the code. In this case, the command is “./my_code”. You will see that “Hello,world!” is printed on console screen.

18 5. Compiling the code Red boxes show the gcc command
Blue boxes show the output command

19 Congratulation! You have written your 1st code in the lab! 

20 Off Campus access Download TAMU VPN. Use it to access the server. Link: Network_VPN/index.php Map you home directory in you personal computer Download and setup PuTTY for Windows. For Mac, use ssh terminal. Now, you can access the server and use it for coding.

21 Practice Problem (Won’t be graded)
Problem 1. Write a program that prints out a two-line message of your own choosing. Problem 2. Write a program with a char variable and an int variable and store the value 'E' and 5 in them. Print them on a line with a message saying what each one is. Example: "char: E, int: 5"

22 Thank You!


Download ppt "CSCE 206 Lab Structured Programming in C"

Similar presentations


Ads by Google