CS1010E Programming Methodology. POH YEE HUI Electrical Engineering Year 3

Slides:



Advertisements
Similar presentations
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Advertisements

CS1020 Week 3: 29th January 2015.
Week 4 – Functions Introduction. Functions: Purpose Breaking a large problem into a series of smaller problems is a common problem- solving technique.
CS1010 Programming Methodology
1 Reading Assignments Linux, g++ & dropboxes Simple C/C++ Program (again) Edit, Compile, Test, Submit CSE Lecture 2 – More Preliminaries.
Unix. Outline Commands Environment Variables Basic Commands CommandMeaning lslist files and directories ls -alist all files and directories mkdirmake.
TDBA66, VT-03 Lecture - Ch. 21 A complete C-program Display Fig. 2.1 and comment on different things such as Preprocessor directives Header files Identifiers.
The scanf Function The scanf function reads input from the standard input device into one or more variables Example: scanf(“%lf”, &miles); Reads a real.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
Declarations/Data Types/Statements. Assignments Due – Homework 1 Reading – Chapter 2 – Lab 1 – due Monday.
1 Introduction to Computers and Programming Class 3 Introduction to C Professor Avi Rosenfeld.
1 CSE1301 Computer Programming: Lecture 9 Input/Output.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 6P. 1Winter Quarter I/O in C Lecture 6.
Basic Input/Output and Variables Ethan Cerami New York
Computer Science 210 Computer Organization Introduction to C.
Ping Zhang 10/08/2010.  You can get data from the user (input) and display information to the user (output).  However, you must include the library.
Learning basic Unix command IT 325 operating system.
Chapter 5: Data Input and Output Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
Advanced UNIX Shell Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
A Guide to Unix Using Linux Fourth Edition
Yu Yuanming CSCI2100B Data Structures Tutorial 3
CP104 Introduction to Programming File I/O Lecture 33 __ 1 File Input/Output Text file and binary files File Input/output File input / output functions.
CS 6560 Operating System Design Lecture 3:Tour of GNU/Linux.
#include int main(void) { printf("Hello, world!\n"); return 0; } entry point called on program start only one main( ) in any program # for preprocessor.
/* C Programming for the Absolute Beginner */ // by Michael Vine #include main() { printf(“\nC you later\n”); system(“pause”); }
How to start Visual Studio 2008 or 2010 (command-line program)
C Programming Lecture 5 : Basic standard I/O Lecture notes : courtesy of Ohio Supercomputing Center, science and technolgy support.
Chapter 7 Formatted input and output. 7.1 introduction Tax: This result is correct; but it would be better Maybe as $13, Make formatting.
Structure of a C program Preprocessor directive (header file) Program statement } Preprocessor directive Global variable declaration Comments Local variable.
NA2204.1jcmt CSE 1320 Intermediate Programming C Program Basics Structure of a program and a function type name (parameters) { /* declarations */ statement;
File IO and command line input CSE 2451 Rong Shi.
Chapter 3 Input and Output
CSE1301 Computer Programming: Lecture 6 Input/Output.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
CSE 1320 Basics Dr. Sajib Datta
CSCI 130 Basic Input and Output Chapter 9. The printf ( ) function Printf(“\nThe value of x is %d”, x); Displayed to screen (assume x = 12): –The value.
Introduction to UNIX and Linux.  Written by Dennis Ritchie and Ken Thomsom at Bell Labs in 1969  Initially written in assembly language and a high-level.
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Engr 0012 (04-1) LecNotes Engr 0012 (04-1) LecNotes Contrasting MATLAB with C MATLABC language Workspace - interactive computation No real.
INTRODUCTION TO PROGRAMING System Development Mansoura October 2015.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Input, Output and Variables GCSE Computer Science – Python.
C language--Introduction. History 1970: B by Ken Thompson at AT&T Bell Lab 1972: C by Dennis Ritchie and Ken Tompson at At&T Bell Lab for UNIX 1978: “The.
Introduction to Computing Lecture 03: Basic input / output operations Introduction to Computing Lecture 03: Basic input / output operations Assist.Prof.Dr.
Lecture2.
CSCE 206 Structured Programming in C
Formatted Input and Output
Zhang Hongyi CSCI2100B Data Structures Tutorial 3
Chapter 7 Text Input/Output Objectives
Formatted Input/Output
INC 161 , CPE 100 Computer Programming
Introduction to C CSE 2031 Fall /3/ :33 AM.
Getting Started with C.
Tutorial of Unix Command & shell scriptS 5027
Formatted Input/Output
Tutorial of Unix Command & shell scriptS 5027
Compiled and ready to run Memory Stack /*
CSI 121 Structured Programming Language Lecture 7: Input/Output
CC213 Programming Applications
CSCE 206 Lab Structured Programming in C
Tutorial of Unix Command & shell scriptS 5027
Introduction to C Topics Compilation Using the gcc Compiler
#include <stdio.h> int main(void) { printf("Hello, world!\n");
Introduction to C Topics Compilation Using the gcc Compiler
Introduction to C Programming
CSCE 206 Lab Structured Programming in C
Functions, Part 2 of 3 Topics Functions That Return a Value
Introduction to C CSE 2031 Fall /15/2019 8:26 AM.
Presentation transcript:

CS1010E Programming Methodology

POH YEE HUI Electrical Engineering Year 3

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) –mv:MoVe (cut and paste + rename) –rm: ReMove (delete)

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

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

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

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

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

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

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

Good Luck!! Have Fun!! Poh Yee Hui