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
Spring 2019 Lecture 1

2 TA Luna Backes Email: luna.backes@tamu.edu Office: HRBB 525
Office Hours: M & 2:30 PM – 4:00 PM* Lab Homepage: * If you have a conflict, please let me know! * I am available between labs M & 5:10-5:40 PM * I am also available by and TAMU’s Google Hangouts

3 Peer Teachers Section 501: Mark McCauley, Miguel Sortos
Section 502: Mark McCauley, Roesha Nigos Details: teachers.html

4 Lab Highlights Problem solving using C programming language
5 programming assignments, each consisting of 3-5 typical problems gcc compiler of departmental linux server will be used for lab and assignments You can use IDE like visual studio and xcode for learning Try to utilize the lab hours efficiently Group study is helpful to share ideas about coding style and debugging You must work out your lab assignments individually Google and StackOverflow are your best friends!

5 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:

6 Workflow by example

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

8 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: open folder explorer  Click in “This PC”  Click on the “Computer” tab  Click in “Map network drive”  Select “H:” drive (or any empty)  Folder: \\coe-fs.engr.tamu.edu\Ugrads  Finish  (see details below to sign in) 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. Replace “your_netid” by YOUR netid Details*: *URL starting with wiki.cse.tamu.edu can not be accessed directly off campus. You need to use TAMU VPN for that. Details:

9 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!

10 2. Write the code Using notepad++ or 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 Only if you use a text editor that does that (like Notepad++ or xcode)

11 1st Program- “Hello, World!”
/* First program */ #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; }  Important: if you copy paste your code from here, it might introduce weird characters when you paste it in the text editor. If you get many errors compiling, try to delete and rewrite the special characters: /, *, #, <, {, }, (, ), “, . and ;

12 3.1. Windows: Connect to Server
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 for the first time, a dialogue box will appear. Press Yes. Use your netid and password for access

13 3.2. Mac: Connect to Server Open “iTerm” or “terminal”
Type ssh -l your_netid linux2.cs.tamu.edu Use your credentials to access the server When you type the password, you won’t be able to see anything, just keep typing it and press enter If you take too long to type your password, the connection will close. If that happens, close PuTTY and reopen it again.

14 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, color may vary) 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:

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

16 5. Compiling the code Once you are in the directory with the code file, run the command: gcc my_code.c –o my_code Where “gcc” is the compiler, my_code.c is the file with your code (EXACTLY as shown by ”ls”) and my_code will be the output executable generated by the compiler If the code compiles successfully, a new file “my_code” will be created Use ls command to check If the code does not compile, it will show some error. Debug the code. Google the error or ask if you don’t know how to proceed. Run “./my_code” command to run the executable You will see that “Hello,world!” is printed on console screen.

17 5. Compiling the code Red boxes: gcc command
Blue boxes: output command

18 You have written your 1st code in the lab! 
Congratulations! You have written your 1st code in the lab! 

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

20 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"


Download ppt "CSCE 206 Lab Structured Programming in C"

Similar presentations


Ads by Google