Lecture 15: Course Review BJ Furman ME 30 16MAY2011.

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
Advertisements

Introduction to C Programming
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect FXP. 1Winter Quarter Course Wrap Up and Final Review Topics Lecture.
Lecture 3: Control Structures - Selection BJ Furman 10SEP2012.
Programming and Data Structure
Programming Languages and Paradigms The C Programming Language.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
1 Conditional Statement. 2 Conditional Statements Allow different sets of instructions to be executed depending on truth or falsity of a logical condition.
Week 4: Control Structures - Repetition
C Programming Revision Malcolm Wilson. Variables Types int, char, double, long. NO type for string see later. unsigned above. assignment X=2 ; C=‘v’;
C++ Basics Prof. Shermane Austin. Learning Programming Language Basics Data Types – simple Expressions Relational and Logical Operators Conditional Statements.
COMP1180 Review Date: 4 March, 2009 Time: 10:30am - 12:20pm Venue: –CS students -- FSC801C and FSC801D –IS and other students -- OEE1017 Remarks: – 1)
Differences between Java and C CS-2303, C-Term Differences between Java and C CS-2303, System Programming Concepts (Slides include materials from.
Review for midterm exam Dilshad M. Shahid Spring NYU.
Topic R3 – Review for the Final Exam. CISC 105 – Review for the Final Exam Exam Date & Time and Exam Format The final exam is 120-minutes, closed- book,
Guide To UNIX Using Linux Third Edition
COMP1170 Midterm Preparation (March 17 th 2009) Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect FXP. 1Winter Quarter Course Wrap Up and.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 9P. 1Winter Quarter Switch Case Structures.
The switch Statement, DecimalFormat, and Introduction to Looping
C Programming Language tutorial Powered by:-
UNIT II Decision Making And Branching Decision Making And Looping
CIS3931 – Intro to JAVA Lecture Note Set 3 19-May-05.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Chap 3 – PHP Quick Start COMP RL Professor Mattos.
C Programming Tutorial – Part I CS Introduction to Operating Systems.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
More on Input Output Input Stream : A sequence of characters from an input device (like the keyboard) to the computer (the program running). Output Stream.
Control Statements Spring Semester 2013Programming and Data Structure1.
Chapter 3 Control Flow Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
C Programming n General Information on C n Data Types n Arithmetic Operators n Relational Operators n if, if-else, for, while by Kulapan Waranyuwat.
CS 101E – Exam 2 Review Spring 2007 Michele Co. Announcements Review Session Tonight, 7/7:30 p.m., OLS 009 Will be announced via In-class Exam Wednesday.
CSC 2400 Computer Systems I Lecture 5 Pointers and Arrays.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
1 Advanced Programming IF. 2 Control Structures Program of control –Program performs one statement then goes to next line Sequential execution –Different.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
Chapter 05 (Part III) Control Statements: Part II.
CSC1201: Programming Language 2 Lecture 1 Level 2 Course Nouf Aljaffan (C) CSC 1201 Course at KSU1.
Week 6: Functions - Part 2 BJ Furman 01OCT2012. The Plan for Today Comments on midterm exam (next week in lab!) Review of functions Scope of identifiers.
Introduction to C Programming CE Lecture 3 Control Structures in C.
IT CS 200: C ONDITION Lect. Napat Amphaiphan. T HE ABILITY TO CONTROL THE FLOW OF YOUR PROGRAM, LETTING IT MAKE DECISIONS ON WHAT CODE TO EXECUTE 2.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
Lecturer: Nguyen Thi Hien Software Engineering Department Home page: hienngong.wordpress.com Chapter 2: Language C++
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
CPS120 Introduction to Computer Science Exam Review Lecture 18.
Department of Electronic & Electrical Engineering Lecture 3 IO reading and writing variables scanf printf format strings "%d %c %f" Expressions operators.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Week 5: Microcontrollers & Flow Control Bryan Burlingame 2 March 2016.
1 Midterm 1 Review. 2 Midterm 1 on Friday February 27 Closed book, closed notes No computer can be used 50 minutes 4 or 5 questions write full programs.
CS113 Introduction to C Instructor: Ioannis A. Vetsikas Lecture 2 : August 28 webpage:
Engr 0012 (04-1) LecNotes Engr 0012 (04-1) LecNotes Contrasting MATLAB with C MATLABC language Workspace - interactive computation No real.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
UMBC CMSC 104 – Section 01, Fall 2016
ECE Application Programming
- Standard C Statements
Decisions Chapter 4.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
C Short Overview Lembit Jürimägi.
TMC 1414 Introduction to Programming
11/10/2018.
CS 2308 Exam I Review.
CS1100 Computational Engineering
Your questions from last session
Fundamental Programming
Decision making and control functions
Programming Languages and Paradigms
Dale Roberts, Lecturer IUPUI
Presentation transcript:

Lecture 15: Course Review BJ Furman ME 30 16MAY2011

The Plan for Today Review of what we covered this semester  Overview of computers and programming  Algorithm development  Selection structures  Operators  Repetition structures  Modular programming  Pointers and Arrays  Strings  File I/O  Embedded programming  Spreadsheets for engineering computation  Matlab/Octave for engineering computation

Learning Objectives List the important concepts we covered Develop a plan to prepare for the final exam

Overview of computers and programming Where and how computers are used by MAEs  List some of the major areas  List some of the software Memory and addresses  Hex numbers as a shorthand for 4-bit chunks Data types  naming and declaration  memory allocation Formatted I/O with printf and scanf Focus of ME 30

Algorithm Development List and describe the steps in designing a program Articulate what is meant by an algorithm Be able to generate pseudocode for an algorithm

Selection Structures Be able to apply the three kinds of selection structures:  if  if/else  switch Syntax and logic Relational operators ( >= != ==)  test for equality Logical operators ( &&, | |, ! )  Used in compound expressions for selection decision  Bit-wise ( &, |, ~, ^ )

Repetition Structures Be able to apply the three kinds of repetition structures:  while  do/while  for Syntax and logic

Modular Programming (functions) Why are functions important? Working with functions  function prototype  defining a function return data type passing arguments Scope of variables  Program (global scope)  File (just in the immediate source file)  Function-prototype (just in the prototype)  Function (applies only to labels)  Block (“between the { } scope”) Pointers and returning multiple values

Pointers and Arrays What is a pointer?  A variable that holds an address for a memory location int *ptr1 = &myvar1 ; // defines a pointer to an int and assigns the memory location of the variable myvar1 Using the indirection operator to get the value pointed to int myvar1 = 32 ; int *ptr1 = &myvar1; *ptr1 = *ptr1 + 1; // myvar1 == ?? What is an array? Declare and initialize an array Access elements in an array  remember that in C, indexing starts at 0! Arrays and pointers

Strings What is a string?  NUL ( \0 ) terminated array of characters String constant, string variable  "Hello, world";  char a[ ] = "Hello, world"; How many elements in this array?  sizeof (a) / sizeof (char); Access elements in an string variable  remember that in C, indexing starts at 0! Strings and pointers  Name of string variable is treated like a pointer to its first element

Microcontrollers Handling printed circuit boards Arduino microcontroller Inputs and Outputs  How to specify whether a pin is an input or output Programming the Arduino Reading to and writing from digital pins Reading to and writing from analog pins Writing a program for the Arduino  setup()  loop()

Excel for Engineering Applications Chart types  Scatter vs. line Opening data files Annotating charts for publication Trend line and regression Using Solver Macros

Matlab/Octave for Engineering Applications Array and vector creation  Array indexing starts with 1 Manipulating elements in arrays Matrix operations Script files and functions File I/O Plotting

Review

References

IF Structure Syntax if(expression) /* if expression is TRUE (not equal to zero) */ { statement1; /* then execute statements between { } */ statement2; } else { statement3; /* otherwise execute these statements */ statement4; }

Switch-case structure switch(expression) // Expression must result in an integer value { case match1: // if exp is match1, then execute statements between { } { statement1; } break; case match2: // if exp is match1, then execute statements between { } { statement2; } break; default: // if no match, then execute statements between { } { statement3; } break;

WHILE Structure Syntax while(expression) /* if expression is TRUE (!= zero) */ { statement1; /* then execute statements between { } */ statement2; }

DO-WHILE Structure Syntax do { statement1; // do the stuff between the { } statement2; } while(condition); // while condition is true

FOR Structure Syntax for(i=0; i<5; i++) { statement1; // do the stuff between the { } statement2; }