Information Technology for Engineers

Slides:



Advertisements
Similar presentations
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Advertisements

COMP1180 Review Date: 4 March, 2009 Time: 10:30am - 12:20pm Venue: –CS students -- FSC801C and FSC801D –IS and other students -- OEE1017 Remarks: – 1)
C Programming Basics Lecture 5 Engineering H192 Winter 2005 Lecture 05
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Outline Variables 1.
Help session - C++ Arranged by : IEEE – NIIT Student Chapter.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
M. Taimoor Khan #include void main() { //This is my first C++ Program /* This program will display a string message on.
Practice 1 Seoul National University Graphics & Media Lab.
1 CSE1301 Computer Programming Lecture 5: Components of a C Program (Part 1) Linda M c Iver.
/* C Programming for the Absolute Beginner */ // by Michael Vine #include main() { printf(“\nC you later\n”); system(“pause”); }
M.T.Stanhope Oct Title : C++ Basics Bolton Institute - Faculty of Technology (Engineering) 1 C++ Basics u Data types. u Variables and Constants.
CECS 121 Test 1. Functions allow you to group program statements under one name C and C++ are case-sensitive so main(), MAIN(), and Main() are all different.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics.
Chapters 1-5 Review C++ Class. Chapter 1 – the big picture Objects Class Inheritance Reusability Polymorphism and Overloading.
CSC1201: Programming Language 2 Lecture 1 Level 2 Course Nouf Aljaffan (C) CSC 1201 Course at KSU1.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
CECS 130 EXAM 1. To declare a constant (read only) value: const int x = 20; const float PI = 3.14; Can we do this? const int x;
GUJARAT KNOWLEDGE VILLAGE Faculty Name:- Prof H.M.Patel Students Name:- SONI VISHAL THAKKER BHAVIN ZALA JAYDIP ZALA.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Lecturer: Nguyen Thi Hien Software Engineering Department Home page: hienngong.wordpress.com Chapter 2: Language C++
C++ Basics Programming. COMP104 Lecture 5 / Slide 2 Introduction to C++ l C is a programming language developed in the 1970s with the UNIX operating system.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
1 Chapter 4 - Control Statements: Part 1 Outline 4.1 Introduction 4.4 Control Structures 4.5 if Selection Structure 4.6 if/else Selection Structure 4.7.
C++ Lesson 1.
Chapter 1.2 Introduction to C++ Programming
Chapter Topics The Basics of a C++ Program Data Types
Chapter 1.2 Introduction to C++ Programming
UMBC CMSC 104 – Section 01, Fall 2016
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
Chapter 2: Introduction to C++
ECE Application Programming
BASIC ELEMENTS OF A COMPUTER PROGRAM
Yanal Alahmad Java Workshop Yanal Alahmad
Basic Elements of C++.
C Short Overview Lembit Jürimägi.
CS149D Elements of Computer Science
Chapter 2: Introduction to C++
Introduction to C Programming
Basic Elements of C++ Chapter 2.
DFC1023 PROBLEM SOLVING AND PROGRAM DESIGN
CET 3640 – Lecture 2 Java Syntax Chapters 2, 4, 5
Starting JavaProgramming
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
C++ fundamentals Lecture 1, Chapter 2 – pp /22/2018 Y K Choi.
Variables in C Topics Naming Variables Declaring Variables
Programming Funamental slides
Govt. Polytechnic,Dhangar
Introduction to C Topics Compilation Using the gcc Compiler
CPS120: Introduction to Computer Science
Java Programming Review 1
2. Second Step for Learning C++ Programming • Data Type • Char • Float
Introduction to C Topics Compilation Using the gcc Compiler
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Programming Language C Language.
COP 3330 Object-oriented Programming in C++
Fundamental Programming
C++ Programming Basics
Module 2 Variables, Data Types and Arithmetic
Variables in C Topics Naming Variables Declaring Variables
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Selection Control Structure
Variables in C Topics Naming Variables Declaring Variables
Variables in C Topics Naming Variables Declaring Variables
Presentation transcript:

Information Technology for Engineers FE11A/ENGR1001 Recap

FE11A/ENGR1001 Mid Term When: Thursday 3rd November, 2005. When: 1:30pm – 4:00pm. Where: MD2 & MD3 – Civil Building. Group 1: MD2. Group2: MD3. Group 1 –Mechanical, Chemical. Group 2 – Civil, Surveying, Geosciences.

Proper IDE Usage

Break

Control Structures Sequence; Selection; Repetition; Invocation.

Sequence

Comments // Single line Comments Block Comments /* Program Name Description Assumptions */

Preprocessor Commands Header Files #include <iostream.h> Types of Header Files <iostream.h> <stdlib.h> <math.h> <iomanip.h> <string.h>

Main Functions int main() void main()

int main int main() { Statements; return 0; }

void main void main() { Statements; return; // not always necessary }

Pseudocode BEGIN / START statements END / STOP

Data Types Unsigned / Signed Interger types short int int long int char Real / Floating Point types float double long double

Variable Naming Scheme See Page138 in Manual. (Very, very, very important)

Variable Declaration Data-type variable-name //comment int score;//holds student score double rate;//holds interest rate char opselect;//holds control character

Pseudocode DECLARE AS INTEGER score DECLARE AS DOUBLE rate DECLARE AS CHAR opselect

Variable Initilization Data-type variable-name = value//comment int score = 0;//holds student score double rate = 3.5;//holds interest rate char opselect = ‘x’;//holds control character Const int votingAge = 18;//legal voting age

Pseudocode DECLARE AS INTEGER score, SET AS 0 DECLARE AS DOUBLE rate, SET AS 0.0 DECLARE AS CHAR opselect, SET AS ‘x’

Output PRINT “Hello World!!” Display “Hello World!!” cout<<“Hello World!!”; cout<<“Hello World!!”<<endl; Hello World!!

PRINT “I am ” age “ years old.” cout<<“I am ”<<age<<“ years old.”<<endl; I am 5 years old.

Input READ num1 READ num1, num2 cin>>num1; cin>>num1>>num2;

Escape Characters See page 129.

Arithmetic Addition(+); Subtraction(-); Multiplication(*); Division(/); Modulus(%).

receiving-variable = variable operator variable CALCULATE x = y + z x = y + z;

Incrementing INCREMENT count count++; count=count+1; count+=1;

Decrementing DECREMENT count count = count -1; count--; count -= 1;

Break

Selection

Structures If-else switch One way selection Liner nested Non linear nested switch

If-else if (condition) { statements; } else

Pseudocode IF condition THEN statements ELSE ENDIF

One Way Selection if (condition) { statements; }

Pseudocode IF condition THEN statements ENDIF

Linear Nested if (condition) { statements; } else if else

Pseudocode IF condition THEN statements ELSE IF condition THEN ELSE ENDIF

None Linear Nested if (condition) { statements; }

Pseudocode IF condition THEN statements ENDIF

Switch switch (condition) { case val1: statements; case val2: default: }

Pseudocode SWITCH expression ENDSWITCH condition 1 : sequence 1 default: sequence ENDSWITCH

Break

Repetition

Structures while do…while for

While while (condition) { statements; }

Psudeocode WHILE condition statements ENDWHILE