1 / 11

CS1010E Programming Methodology

CS1010E Programming Methodology. POH YEE HUI. Electrical Engineering Year 3. yhpoh91@nus.edu.sg. MinGW. Unix Shell Emulator Commands: cd : Change Directory (folder) ls : LiSt files mkdir : MaKe DIRectory (folder) rmdir : ReMove DIRectory (folder) cp : CoPy (copy and paste)

denton
Download Presentation

CS1010E Programming Methodology

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. CS1010EProgramming Methodology

  2. POH YEE HUI Electrical Engineering Year 3 yhpoh91@nus.edu.sg

  3. MinGW • Unix Shell Emulator • Commands: • cd : Change Directory (folder) • ls : LiSt files • mkdir : MaKeDIRectory (folder) • rmdir : ReMoveDIRectory (folder) • cp : CoPy (copy and paste) • mv : MoVe(cut and paste + rename) • rm : ReMove (delete)

  4. Vim • Text Editor • Commands • vim program.c (in MinGW): Open program.c file using Vim • i : Insert mode • v : Visual mode (for selection/highlight) • Esc : Command mode • y : Yank (copy) • x: Cut • p : Paste

  5. Skeleton Template #include “stdio.h” int main() { // your code return 0; }

  6. Output (printf) printf(“%d \n”, variable); Format Specifier New line Variable Name %d : integer %lf : double (long float) %c : character %s : string

  7. Input (scanf) scanf(“%d”, &variable); Format Specifier Variable Name %d : integer %lf : double (long float) %c : character %s : string

  8. Operations (+ - * /) circumference = 2 * 3.142 * radius;

  9. Task 1: Distance 1 km = 1.609 miles Get distance in km (input) Convert km to miles Display distance in miles (output)

  10. Task 2: Sum Get 2 integer (input) Get the sum of the integers Display the sum (output)

  11. Good Luck!! Have Fun!! Poh Yee Hui yhpoh91@nus.edu.sg

More Related