Introduction to Computer Science

1999-2000

Instructor: Jinn-Liang Liu

2000 Spring
Exam 1: 4/20/00
Final:     6/19/00

Project 1: 3/30/00 (Savitch, p.287 #9)
Project 2: 4/27/00 (Savitch, p.355 #9)
 
 

1999 Fall
Exam 1: 10/20/99 (15%)   Answers
Exam 2: 11/17/99 (15%)   Answers
Exam 3: 12/15/99 (15%)   Answers
Final    :  1/14/99 (25%)

Project 1: 10/29/99 (10%)
Project 2: 11/26/99 (10%)   Program Output
Project 3: 12/24/99 (10%)

Text Books:

Lecture notes on C++

Chapter 1   Introduction to Computer and C++ Programming

Computer Systems

Hardware, Software, Network

Hareware

Software

Introduction to C++

10/8/99

Chapter 2   C++ Basics

Documentation

Variables

Identifiers

C++ Keywords

Data Types

Values

Functions

  • Syntax 1

  • Type_Name   Function_Name(Type1 Argument1, Type2 Argument2, ...)
    {
         Statement1
         Statement2
         Statement3
         .
         .
         .
        return value; // Return a value of the type Type_Name.
    }
    The argument list Type1 Argument1, Type2 Argument2, ... is optional (with or without it is okay).
  • Syntax 2

  • Type_Returned Function_Name(Type1 Argument1, Type2 Argument2, ...)
    Single_Statement;
  • D2.15: main
  • Operators

    10/15/99

    Comparison (Boolean) Operators

    10/22/99
    Project 1:  #1 in P. 101
     

    Introduction to the Use of Microsoft Visual C++

    Expressions

    Arithmetic Operators and Expressions

    Input and Output (I/O)

    Review D2.15

    10/29/99

    Chapter 3  Functions, Abstraction, Overloading

    Math Problem 1 (MP1): How to compute the number e=2.718281828... using arithmetic operations only?
    Answer: Using a Taylor polynomial
    exp(x)=1+1/x+..... (see Calculus)
    sin(x)=....
    ln(1+x)=....
    Polynomial, Power, Factorial


    Programming Example 1 (PE1): Develope a C++ project for solving MP1.

  • Program 1 (PE1-1): Factorial Function (p. 149)
  • 11/5/99
    Project 2:
    Write a program to compute the number e with the accuracy of the approximation up to 9 significant digits by using a Taylor polynomial.
  • How to use PE1-1? Write a main program to call the factorial function. (See Exam 2)
  • Function Prototype Syntax (p. 119, 126)
  • Function Definition (p. 117, 126)
  • Function Call Syntax (p. 108)
  • Formal Parameters, Arguments (p. 185)
  • Call-by-Value (p. 185)
  • Procedural Abstraction (p. 129, 130)
  • Local Variables (p. 142)
  • Review Project 2.

  • PE1-2: Power Function
  • Predefined Functions (p. 111)
  • Programmer-Defined Functions
  • Automatic Type Conversion (p. 154)
  • Top-Down Design (Divide and Conquer): Break the project into many subprograms. (p. 106)
  • 12/3/99

    12/17/99 計算機與網路中心 電腦教室 4

    Project 3:
    Given f(x)=sum_{n=0}^{n=infinity} ((-1)^(n+k(n)) x^n)/(n!*(n-0.5)) where k(n)=0 if n%4=1 or 2 and k(n)=1 if n%4=0 or 3, compute f(1), f(10), f(20), f(30) up to 12 significant digits.

    12/17/99

    12/24/99 計算機與網路中心 電腦教室 2
    1/7/2000 計算機與網路中心 電腦教室 4
     
     
     

    ------ Scratch below -----

    Polymorphism (p. 153)
    Overloading a function name (p. 151)
    double power(double x, int n);
    double power(double x, double y, int n); Use pow()

    Chapter 4  Void, Call-by-Reference, Abstraction

    Display 4.9 (p. 198)