KATHMANDU ENGINEERING COLLEGE



 COMPUTER PROGRAMMING


11/26/2012
Computer Programming

Description:

    Basic programming-in-the-small abilities and concepts.
    Highlights include procedural and functional abstraction with
    simple built-in data type manipulation.
    Basic abilities of writing, executing and debugging programs.



                                          11/26/2012
So What is Programming Like?

It’s really hard to describe!

Many similarities to solving “word problems”

In math Translate a “problem description“ into a ”formal solution Symbol ”

Some people describe it as “puzzle solving”

Some people describe it as “problem solving”

          A mix of high-level creativity and low-level picky details
                                                   11/26/2012
Stages of Problem Solving

           Ultimate goal: use a computer to solve a problem

Typical stages of building a solution:
      Clearly specify the problem
      Analyze the problem
      Design an algorithm to solve the problem
      Implement the algorithm (write the program)
      Test and verify the completed program
      Maintain and update the program
                                                11/26/2012
Focus


          All stages are important.

In this course, we ignore none of them But we
                   focus on:

Algorithm development
Writing a program to implement the algorithm

                                  11/26/2012
CT 401: COURSE STRUCTURE

100 Marks course

Course Organization:
  Lecture: 4 periods a week
  Tutorial: 1 period a week
  10 minutes of Quiz session during each lecture
  5 Programming projects (To be done by you outside of class, on your
  own time)
  Two midterm exams
  Final exam
                                                 11/26/2012
CT 401: Goals
We will learn
  Read: Understand programs written in C language
  Write: Design and implement programs using C language
  Compile: Use compiler to convert C code into executable file
  Execute: Run corresponding code to get results
  Debug: Identify and fix syntax and semantic errors in C code.
  Prepare: Have Base for learning other high level languages like
  C++, JAVA, etc.
                                              11/26/2012
Using the BOOK

Not everything in the course will be covered in the
slides…. So you are required to refer the BOOKS
Not everything, instructor says, from the slides will
be correct and complete…. So you need to verify
the contents using the BOOK and submit the
summary report in the NEXT CLASS
You need both! And then some...     11/26/2012
Beyond the BOOKS/SLIDES

You won’t learn programming by reading the BOOKS as
might you read the other theoretical subjects

You won’t learn programming by watching the lectures
slides as might you watch a TV program

What you need in addition is:
  The ability to ask questions and get them answered
  And most important: hands-on practice
                                      11/26/2012
The Importance of Practice

You wouldn’t expect to learn to SING/DANCE just by
watching a TV series on it
  There is no substitute for practice. And no one can do it
  for you.

       The same holds for learning to program.

                                        11/26/2012
Tips for Success

Take the material in order
  With rare exceptions:
  you can’t skip any lecture but I won’t take attendance
  you can’t take material out of order

  Seek help if you get behind
 Practice, Practice ….. And MORE PRACTICE!

                                      11/26/2012
Where Do You Go From Here?
The next course is “Object Oriented Programming (OOP)“ in
  the third semester
   A direct continuation of Computer Programming
   OOP introduces the C++ programming language

On the fourth-semester course called "Data Structures“
 continues with the application of C/C++ programming
 Languages                              11/26/2012
What is OOP like?
100 marks; 4-5 projects
  15-30 files in later projects (you don’t write all)
Students say:
   "intense", "time-consuming"
Language: C++
  Initially just like C
  Learn programming concepts to support writing larger programs
  Eventually objects + classes (“object-oriented”)
                                                   11/26/2012
What is Covered in a 2nd and 3rd Courses?

Lots of programming practice
   but less class discussion of it
Data structures
   many involving pointers
   abstract data types (ADTs)
Algorithms
   many recursive
Problem-solving & design
Foundation for later CS courses

                                     11/26/2012
Going on in C
There is much about the C language we won't cover

You will have a foundation to master more advanced C
programming features at the end of the course

Learning more C may or may not be useful but you are
required to PASS the EXAMS for completing your degree
                                     11/26/2012
Programming Concepts

We will use C, but the concepts go beyond the C
 language
  Variables; data types; values
  Conditions: conditional statements and conditional
    execution
  Loops
  Recursion
  Functions: parameters (including pointers), call/return
  Data structuring: arrays; structures;
                                         11/26/2012
  Input/Output
Beyond Programming…
Compiler concepts
   syntax vs semantics; compilation steps; libraries; debugging
What is a computer?
   Visualize memory, CPU, I/O operation
   Instruction execution, data movement
Problem solving
   Abstraction
   Functional decomposition, Data decomposition
Algorithms
                                           11/26/2012
Building and Understanding Software

 Software give computer its personality
   Computers are booming I.e., software is.
 Programs are complex things
   Compare to a bridge or a novel
   What's the effect of a small error?
 Humanizing complexity
   Analysis, design, testing, communicating
                                     11/26/2012
Next Class


Problems, Algorithms, and Programs



                         11/26/2012
Who am I?
Manish Aryal
   Head,
   Department of Computer Engineering
B.E. Computer (KEC, 2003)
M.S. Information and Communication Engineering (Pulchowk Campus,
2005)
Working @ KEC for last EIGHT Years
9841285747
manish@keckist.edu.np
https://www.facebook.com/aryalmanish
7:00 AM – 4:30 PM, Monday- Friday            11/26/2012
Is Programming Hard or is Programming
                Fun?

  Advanced Programming is HARD but Your
                     FUN ...
    Programming Course is also HARD

    Best of Luck for the Course. See You in the Next
                          Class.


                                      11/26/2012

01 computer programming

  • 1.
    KATHMANDU ENGINEERING COLLEGE COMPUTER PROGRAMMING 11/26/2012
  • 2.
    Computer Programming Description: Basic programming-in-the-small abilities and concepts. Highlights include procedural and functional abstraction with simple built-in data type manipulation. Basic abilities of writing, executing and debugging programs. 11/26/2012
  • 3.
    So What isProgramming Like? It’s really hard to describe! Many similarities to solving “word problems” In math Translate a “problem description“ into a ”formal solution Symbol ” Some people describe it as “puzzle solving” Some people describe it as “problem solving” A mix of high-level creativity and low-level picky details 11/26/2012
  • 4.
    Stages of ProblemSolving Ultimate goal: use a computer to solve a problem Typical stages of building a solution: Clearly specify the problem Analyze the problem Design an algorithm to solve the problem Implement the algorithm (write the program) Test and verify the completed program Maintain and update the program 11/26/2012
  • 5.
    Focus All stages are important. In this course, we ignore none of them But we focus on: Algorithm development Writing a program to implement the algorithm 11/26/2012
  • 6.
    CT 401: COURSESTRUCTURE 100 Marks course Course Organization: Lecture: 4 periods a week Tutorial: 1 period a week 10 minutes of Quiz session during each lecture 5 Programming projects (To be done by you outside of class, on your own time) Two midterm exams Final exam 11/26/2012
  • 7.
    CT 401: Goals Wewill learn Read: Understand programs written in C language Write: Design and implement programs using C language Compile: Use compiler to convert C code into executable file Execute: Run corresponding code to get results Debug: Identify and fix syntax and semantic errors in C code. Prepare: Have Base for learning other high level languages like C++, JAVA, etc. 11/26/2012
  • 8.
    Using the BOOK Noteverything in the course will be covered in the slides…. So you are required to refer the BOOKS Not everything, instructor says, from the slides will be correct and complete…. So you need to verify the contents using the BOOK and submit the summary report in the NEXT CLASS You need both! And then some... 11/26/2012
  • 9.
    Beyond the BOOKS/SLIDES Youwon’t learn programming by reading the BOOKS as might you read the other theoretical subjects You won’t learn programming by watching the lectures slides as might you watch a TV program What you need in addition is: The ability to ask questions and get them answered And most important: hands-on practice 11/26/2012
  • 10.
    The Importance ofPractice You wouldn’t expect to learn to SING/DANCE just by watching a TV series on it There is no substitute for practice. And no one can do it for you. The same holds for learning to program. 11/26/2012
  • 11.
    Tips for Success Takethe material in order With rare exceptions: you can’t skip any lecture but I won’t take attendance you can’t take material out of order Seek help if you get behind Practice, Practice ….. And MORE PRACTICE! 11/26/2012
  • 12.
    Where Do YouGo From Here? The next course is “Object Oriented Programming (OOP)“ in the third semester A direct continuation of Computer Programming OOP introduces the C++ programming language On the fourth-semester course called "Data Structures“ continues with the application of C/C++ programming Languages 11/26/2012
  • 13.
    What is OOPlike? 100 marks; 4-5 projects 15-30 files in later projects (you don’t write all) Students say: "intense", "time-consuming" Language: C++ Initially just like C Learn programming concepts to support writing larger programs Eventually objects + classes (“object-oriented”) 11/26/2012
  • 14.
    What is Coveredin a 2nd and 3rd Courses? Lots of programming practice but less class discussion of it Data structures many involving pointers abstract data types (ADTs) Algorithms many recursive Problem-solving & design Foundation for later CS courses 11/26/2012
  • 15.
    Going on inC There is much about the C language we won't cover You will have a foundation to master more advanced C programming features at the end of the course Learning more C may or may not be useful but you are required to PASS the EXAMS for completing your degree 11/26/2012
  • 16.
    Programming Concepts We willuse C, but the concepts go beyond the C language Variables; data types; values Conditions: conditional statements and conditional execution Loops Recursion Functions: parameters (including pointers), call/return Data structuring: arrays; structures; 11/26/2012 Input/Output
  • 17.
    Beyond Programming… Compiler concepts syntax vs semantics; compilation steps; libraries; debugging What is a computer? Visualize memory, CPU, I/O operation Instruction execution, data movement Problem solving Abstraction Functional decomposition, Data decomposition Algorithms 11/26/2012
  • 18.
    Building and UnderstandingSoftware Software give computer its personality Computers are booming I.e., software is. Programs are complex things Compare to a bridge or a novel What's the effect of a small error? Humanizing complexity Analysis, design, testing, communicating 11/26/2012
  • 19.
    Next Class Problems, Algorithms,and Programs 11/26/2012
  • 20.
    Who am I? ManishAryal Head, Department of Computer Engineering B.E. Computer (KEC, 2003) M.S. Information and Communication Engineering (Pulchowk Campus, 2005) Working @ KEC for last EIGHT Years 9841285747 manish@keckist.edu.np https://www.facebook.com/aryalmanish 7:00 AM – 4:30 PM, Monday- Friday 11/26/2012
  • 21.
    Is Programming Hardor is Programming Fun? Advanced Programming is HARD but Your FUN ... Programming Course is also HARD Best of Luck for the Course. See You in the Next Class. 11/26/2012