1 / 20

CSCE 206 Lab Structured Programming in C

CSCE 206 Lab Structured Programming in C. Spring 2019 Lecture 1. TA. Luna Backes Email: luna.backes@tamu.edu Office: HRBB 525 Office Hours: M & W @ 2:30 PM – 4:00 PM* Lab Homepage: http://people.tamu.edu/~luna.backes/csce206_spring19.html * If you have a conflict, please let me know!

adriel
Download Presentation

CSCE 206 Lab Structured Programming in C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 & W @ 2:30 PM – 4:00 PM* Lab Homepage: http://people.tamu.edu/~luna.backes/csce206_spring19.html * If you have a conflict, please let me know! * I am available between labs M & W @ 5:10-5:40 PM * I am also available by email and TAMU’s Google Hangouts

  3. Peer Teachers • Section 501: Mark McCauley, Miguel Sortos • Section 502: Mark McCauley, RoeshaNigos Details: https://engineering.tamu.edu/cse/academics/peer-teachers/current-peer-teachers.html

  4. Lab Highlights • Problem solving using C programming language • 5 programming assignments, each consisting of 3-5 typical problems • gcc compiler ofdepartmental 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: http://people.tamu.edu/~luna.backes/instructions.html

  6. Workflow by example

  7. Basic Setup – Step 1 • Claiming your Computer Science account: https://wiki.cse.tamu.edu/index.php/Claiming_Your_Computer_Science_Accounts *URL starting with wiki.cse.tamu.edu can not be accessed directly off campus. You need to use TAMU VPN for that. Details: https://it.tamu.edu/Network_and_Internet_Access/Virtual_Private_Networks/Virtual_Private_Network_VPN/index.php

  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_netidand password is your TAMU password. • Replace “your_netid” by YOUR netid • Details*: https://wiki.cse.tamu.edu/index.php/Accessing_Your_Files *URL starting with wiki.cse.tamu.edu can not be accessed directly off campus. You need to use TAMU VPN for that. Details: https://it.tamu.edu/Network_and_Internet_Access/Virtual_Private_Networks/Virtual_Private_Network_VPN/index.php

  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: https://wiki.cse.tamu.edu/index.php/PuTTY • 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’tbe able to see anything, just keep typingit 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: http://people.tamu.edu/~luna.backes/unix.html

  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. Congratulations! You have written your 1st code in the lab! 

  19. Off Campus access • Download TAMU VPN. Use it to access the server. Link: https://it.tamu.edu/Network_and_Internet_Access/Virtual_Private_Networks/Virtual_Private_Network_VPN/index.php • Map you home directory in you personal computer http://people.tamu.edu/~nirjhar71/remote%20use.html • Download and setup PuTTY for Windows. For Mac, use ssh in a terminal.https://wiki.cse.tamu.edu/index.php/PuTTY

  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"

More Related