Lect M2P. 1 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Lect M2P. 1

Description:

initializing character strings. using character strings ... comparing and sorting strings (strcpy, strcmp, strlen) Lect M2 P. 9 ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 13
Provided by: GatewayEn9
Category:
Tags: m2p | lect | strings

less

Transcript and Presenter's Notes

Title: Lect M2P. 1


1
Midterm 2 Review Topics
  • Lecture M2

2
Optional Review Session for Midterm 2
  • The review session for ENG H192 second midterm
    will be on Monday, February 26, 2007, in
    McPherson Laboratory, Room 1000, MP 1000.
  • The review will begin at 630pm and last until
    all questions are answered (estimated to be about
    830pm). The TAs will host the review.
  • The midterm will be on Tuesdauy, February 27,
    2007, during your regular ENG H192 class time.

3
What should be on the 2nd midterm exam?
  • Can you name the topics and provide some type of
    organization for these topics?

4
Topics for Midterm 2
  • Repetition structures
  • for for (k1,a0 klt20 kk3) a
  • while k1 a0 while(klt20) k3 a
  • do while k1 a0 do k3 a
    while(klt20)
  • Selection structures
  • if
  • if else
  • if else if else

5
Topics for Midterm 2
  • File I/O
  • FILE statement
  • detecting an EOF
  • functions fopen, fclose, fscanf, fprintf, fgets
  • feof
  • example
  • FILE fptr int k,a float b,c
  • fptrfopen(data.dat,r) kfscanf(fptr,f,b)
  • if(feof(fptr)kEOF) printf(End of File\n)

6
Topics for Midterm 2
  • I/O
  • formats, including the specifications for the
    various data types -- d, f, c, ld, s, p
  • functions scanf, printf, getchar, putchar
  • examples
  • int k,a float b,c
  • k scanf (fdf, b, a, c)
  • if (kEOF) printf (End of file\n)
  • else if (klt3) printf (Conversion Error\n)

7
Topics for Midterm 2
  • Arrays (one and two dimensional)
  • declaring an array
  • initializing an array
  • using (how to index) an array
  • Pointer variables
  • declaring a pointer variable
  • initializing a pointer
  • dereferencing a pointer
  • Arrays, Pointers, Values, and Addressing (like
    quiz 4)

8
Topics for Midterm 2
  • Character strings
  • declaring character strings (arrays of
    characters)
  • initializing character strings
  • using character strings
  • functions in ltstring.hgt and ltstdio.hgt for
    handling and doing string I/O
  • comparing and sorting strings (strcpy, strcmp,
    strlen)

9
Topics for Midterm 2
  • User-written functions
  • function prototype
  • function definition
  • function invocation
  • User libraries
  • user-written header files
  • user library files
  • using a user library file on CC command

10
Topics for Midterm 2
  • MATLAB
  • basic syntax
  • vectors and matrices
  • math operators
  • loading data
  • plotting data
  • labeling axes and plots
  • writing a MATLAB function
  • programming in MATLAB

11
Topics for Midterm 2
  • Engineering Laboratory (Lab 1, Lab 3, Lab 4)
  • Data acquisition system basics
  • Analog Power Supply
  • Stress and Strain
  • Questions may be taken from the lab experience
    write-ups available on the FEH web site

12
"Notes Page" for Midterm 2
  • You may bring one (1) 8.5 X 11 inch piece of
    paper on which you may have any notes that would
    be helpful to you for this midterm.
  • The "notes paper" will be turned in with the
    exam. Put your name on your notes paper.
  • Except for the "notes paper", the midterm will be
    a closed book exam.
  • The exam will be entirely a "paper-and-pencil"
    test. No use of the computer will be required or
    allowed.
  • You may use a calculator if you so wish.
Write a Comment
User Comments (0)
About PowerShow.com