Week1 Lec1 Syllabus Introduction Ch1 Fa24
Week1 Lec1 Syllabus Introduction Ch1 Fa24
Lecture 1
Fall 2024
Sheikh Usama Khalid
Department of Computer Science
100 Building, Clifton, Room 301
[email protected]
Lecture Plan
• Introduction
Fundamentals of Programming
• Course Syllabus
• Sample C Program
• Chapter 1: Introducing C
Introduction
• Introduce yourself.
Fundamentals of Programming
Course Overview
• Course
• Class Timings
Fundamentals of Programming
• Course Material
• Marks Instruments
• Grading
• Attendance
• What to Avoid
• Keys to Success
• Syllabus / Topics
Course Credit Hours
• Fundamentals of Programming: 4 Credit Hours Course
– Theory: 3 Credit Hours ( 1 Classes / Week )
Fundamentals of Programming
5
Class Timings [ To Review ]
Section Day Time Room / Lab
E Wednesday 11:30 - 02:45 100 Building, ----
Fundamentals of Programming
6
Course Objectives
• Course Objective:
– Learning about problem solving skills
Fundamentals of Programming
7
Course Material
• Google Class Room:
• Section E: https://classroom.google.com/c/NzEyNTI3ODc0MDA3?cjc=zswyvod
Fundamentals of Programming
• Section F: https://classroom.google.com/c/NzEyNzM4MjY5NTQ3?cjc=33iq6e3
• Section G: https://classroom.google.com/c/NzEyNzQyMTkxOTI3?cjc=rwqdj5a
• Section H: https://classroom.google.com/c/NzEyNzQ1NDgzODcy?cjc=psknlci
• Questions/Discussions:
Mondays Wednesdays
Counseling
Hours 03:00 - 6:00 03:00 - 6:00
8
Marking Heads
• Exams(2)
• Midterm - 8th week
• Final - 16th week
Fundamentals of Programming
• Project(1)
• Proposal Submission - 10th week
• Project Demonstration and Evaluation - 15th week
• Quizzes(1/2)
• Before Midterm - 6th week
• Before Final - 14th week
• OR to be announced in class as and when required
• Assignments(1/2)
• Before Midterm - 6th week
• Before Final - 14th week
• OR to be announced in class as and when required
• These may become part of midterm / final exam as well.
9
Marks Instruments
• Project
• 2 or 3 students per group
Fundamentals of Programming
10
Grading
Marks
Marks Head Total Frequency Total Marks / Head
/ Frequency
Midterm Exam 1 20 20
Fundamentals of Programming
Final Exam 1 40 40
Quizzes 1 10 10
Assignments 1 10 10
Project
1 20 20
Class Participation Bonus Marks
100
11
Books
• Text Book:
• C Programming: A Modern Approach by K. N. King
2nd Edition, W. W. Norton & Company, 2008.
• Reference Books:
Fundamentals of Programming
Classes )
13
What to avoid?
• Things to avoid
• Coming late
Fundamentals of Programming
• Plagiarism
14
Plagiarism
• You must never copy solutions from any source or give your
homework to another student. Cheating will result in a failing grade
Fundamentals of Programming
15
Course Syllabus
• Introducing C
• First Program in C
Fundamentals of Programming
• C Fundamentals
• Formatted Input / Output
• Expressions, Basic Types
• Selection Statements
• Loops, Nested Loops
• Arrays
• Functions
16
Course Syllabus
• Passing Arguments to Functions
• Scope Rules
Fundamentals of Programming
• Program Organization
• Debugging and Error Tracking
• Pointers
• Pointers for Array Processing
• String, [ Searching, Sorting]
• Structures, Unions, Enumerations
• Filing
17
Online Learning
• Coursera, https://www.coursera.org/
• Udemy, https://www.udemy.com/
Fundamentals of Programming
• edX, https://www.edx.org/
• MITOpenCourseWare https://ocw.mit.edu
• OpenSAP, https://open.sap.com/
18
Online Learning
• Udacity, http://www.udacity.com/
• Skillshare, http://www.skillshare.com/
Fundamentals of Programming
19
Class Focal Person
• Class Representative.
• Name?
Fundamentals of Programming
20
Any Questions?
• Should you have any questions, please don’t hesitate to ask.
Fundamentals of Programming
21
Course Pre-requisites
• Not Applicable
Fundamentals of Programming
Keys to success
• Code, code and code….
• You can’t remember coding….
Fundamentals of Programming
23
Good Computer Scientist
• Self-learner
• Desire for innovations
Fundamentals of Programming
• Think logically
• Avoids distractions and follows a plan
• Keeps patience and focuses on the target
• Over the time acquires knowledge of computer science application
domains
• Is a good team worker with good communication skills
• Takes care of his/her health
24
Background Info
• What is DOS?
Fundamentals of Programming
25
Fundamentals of Programming
Sample C Program
Sample C Program
/* Illustrates comments, strings, and the printf function */
Fundamentals of Programming
#include <stdio.h>
int main(void)
{
printf("To C, or not to C: ");
printf("that is the question.\n");
return 0;
}
Sample C Program (contd.)
Writing a sample C program would help us understand the answers to following
questions.
Fundamentals of Programming
• What is an editor?
C
Chapter 1: INTRODUCING
History of C
• Designed and implemented by Dennis Ritchie of Bell Labs between 1969 and 1973.
• Created to serve as the implementation language for the UNIX operating system.
Fundamentals of Programming
• Named after the B language, its immediate predecessor (B language was based on BCPL,
a system programming language).
• Became popular during the 1980s, both for UNIX programming and for developing
applications for personal computers.
• Dennis Ritchie’s article, “The Development of the C Language,” can be found on the web
at cm.bell-labs.com/cm/cs/who/dmr/chist.html.
Versions of C
• K&R C
Described in Kernighan and Ritchie, The C Programming Language, Prentice-Hall, 1978
• C99
International standard ISO/IEC 9899:1999
Advantages of C
• Advantages
– Efficient: Runs quickly, Programs may execute on systems with limited memory.
Fundamentals of Programming
– Difficult to understand
– Difficult to maintain
Recommendations
• Recommendations
– Use libraries of existing code (both to save time and increase reliability).
lower case c)
• Turbo C: Alt+F9
Fundamentals of Programming
• Turbo C: Ctrl+F9
• Dev C++/CodeBlocks: Ctrl+F10
• CodeBlocks F9
Let’s Program
• Steps:
• Open Dev C++ IDE
Fundamentals of Programming
#include <stdio.h>
int main(void)
{
printf("To C, or not to C: ");
printf("that is the question.\n");
return 0;
}
Compile Program
• Let’s Do It…
Fundamentals of Programming
Debugging Program
• Let’s Do It…
Fundamentals of Programming
Executing Program
• Let’s Do It…
Fundamentals of Programming
Review Program Output
• Let’s Do It…
Fundamentals of Programming
Practice
• Use of printf();
• Use of getche();
Fundamentals of Programming
• Use of clrscr();
• Use of newline character \n
• declaring a variable - integer
• printing a variable - integer
• Format Specifier for integer %d
Use of printf();
Task: Print your name….
Fundamentals of Programming
#include <stdio.h>
int main(void)
{
printf(“My name is ");
printf(“Ahmed Ali\n");
return 0;
}
Practice
• Use of printf();
• Use of getche();
Fundamentals of Programming
• Use of clrscr();
• Use of newline character \n
• declaring a variable - integer
• printing a variable - integer
• Format Specifier for integer %d
Sample C Program (contd.)
It’s time to answer following questions.
• What is an editor?
Fundamentals of Programming
C Code
Fundamentals of Programming
C Program Compilation (Another
View)
Fundamentals of Programming
Preprocessor
For example
#include -- includes contents of a named file. Files usually called header files. e.g
#include <math.h> -- standard library maths file.
#include <stdio.h> -- standard library I/O file
#define -- defines a symbolic name or constant. Macro substitution.
#define MAX_ARRAY_SIZE 100
C Compiler
• On a UNIX system you may see files with a .o suffix (.OBJ on MSDOS)
to indicate object code files.
Link Editor
source files the link editor combines these functions (with main()) to
create an executable file ( .exe file ) . External Variable references are
also resolved here.