Sie sind auf Seite 1von 29

Computer Programming &

Utilization
UCT-144
(Batch-2017)
Common to all branches of first year

First Year, 1st Semester

University Institute of Applied Science


Subject Name : Computer Programming & Utilization
Subject Code : UCT-144
Class : common to all branches of first year
Semester : First Year, 1st Semester
L T P Cr Internal Marks External Marks
Credits :
2 0 0 2 40 60

Prerequisite : Basic C Programming Language Knowledge

Contact Hours : 30
Course Objective

 To understand the basic principles of programming


 To learn C language for modeling real world problems.

Unit Course Outcome:-Students will be able to

1. Apply fundamental principles of problem solving .

2. Apply basic programming principles using C language.


Computer Programming & Utilization
Syllabus
UNIT-1 [10]L
• Introduction to computer and programming: Introduction, Basic block diagram
and functions of various components of computer, Flow charts and Algorithms.
What is programming, Machines and Knowledge about problem solving, What are
programs, How to program, Steps followed in Program Development, Importance
of Discipline in Programming, Good Programs and Bad Programs
• Fundamentals of C: Features of C language, structure of C Program, comments,
header files, data types, constants and variables, operators, expressions,
evaluation of expressions, type conversion, precedence and associatively, I/O
functions
• Control structure in C: Simple statements, Decision making statements, looping
statements, nesting of control structures, break and continue ,goto statement
• Case Study: Implementation of a project in C
Computer Programming & Utilization
Syllabus
UNIT-2 [10]L
• Array & String: Concepts of array, one and two dimensional arrays, declaration
and initialization of arrays, string, string storage, Built-in-string functions
• Functions: Concepts of user defined functions, prototypes, definition of
function, prarameters, parameter passing, calling a function, recursive function,
Macros, Pre-processing
• Pointers: Basics of pointers, pointer to pointer, pointer and array, pointer to
array, array of pointers, functions returning a pointer
Computer Programming & Utilization
Syllabus
UNIT-3 [10]L
• Structure: Basics of structure, structure members, accessing structure members,
nestedstructures, array of structures, structure and functions, structures and
pointers
• Dynamic memory allocation: Introduction to Dynamic memory allocation,
malloac, Calloc.
• File management: Introduction to file management and its functions
References
Text & Reference Books:
• 1. Programming in ANSI C by Balaguruswamy
• 2. Programming in C Ansi standard, by YashwantKanetkar
• 3. Programming with C, Gottfried, McGraw-Hill.
Instructions for the Paper-Setter
• Please go through these instructions thoroughly and follow the same
pattern while setting the paper as the students have been prepared
according to this format.
• Maximum Marks = 60 Time: 3 Hrs
• Weightage per unit = 20 marks (excluding over attempt weightage)
1. Question Paper will consist of ten questions.
2. Section A of question paper is compulsory, containing five parts each of 2
marks covering the whole syllabus (short answer type- total 10 marks)
3. Set three questions from each unit I, II and III. Students will attempt 5
questions selecting at least one question from sections B, C & D. Each
question carries 10 marks. Questions of Section B will be from unit I,
Questions of Section C from unit II and Questions of section D from unit III
4. In the question paper, distribution of the questions should be by
considering 30 % numerical part and 70 % conceptual.
Computer Programming &
Utilization UCT-144
UNIT-I
Introduction to computer &
Programming
Design By:
Er. Jasleen Kaur
Assistant Professor (Applied Science)

University Institute of Applied Science


Contents
• Introduction: Basic block diagram and functions of various
components of computer
• Flow charts and Algorithms
• Programming, Machines
• Knowledge about problem solving,
• What are programs, How to program, Steps followed in Program
Development,
• Importance of Discipline in Programming, Good Programs and Bad
Programs

05-01-2018
Definition of Computer
• A computer is an electronic device used to store and process
information.
• It plays a major role in our lives.
• You use computers in education and research.
• You also use them for broadcasting news, receiving and sending
messages to family and friends, making presentations, maintaining
official and personal records, making weather forecasts, and for
various other business and recreation activities.
• By using computers, you save a lot of time, effort, and money.

05-01-2018
Internally

1. Optical Drive
2. AirPort Extreme Card slot
3. System Blowers
4. Hard Drive
5. Right Speaker
6. I/O Ports
7. Power Supply
8. Diagnostic LEDs
9. Power PC G5 Processor
10.DIMM slots
11.Left Speaker
05-01-2018 Fig1. Internal structure of Computer
Connections

1. AirPort Antenna
2. Bluetooth Antenna
3. Optical Audio out
4. Optical Audio in
5. Analog Audio out
6. Analog Audio in
7. USB 2.0
8. FireWire 400
9. FireWire 800
10.10/10/1000BASE-T Ethernet
11.Modem
Fig2. Connections
05-01-2018
Block Diagram of Computer

Program Input Storage Output


Results on the
and Data Unit Unit Unit
basis of decisions

Control
Unit

ALU

Fig3. Block Diagram of Computer


05-01-2018
Block Diagram of Computer
• INPUT UNIT
• Keyboard, mouse, joystick, scanner, touch screen
etc.
• STORAGE UNIT
• Primary Devices : e.g. RAM,ROM
• Secondary Devices: e.g. HDD, Floppy Disk, CD-
ROM, CD-R, DVD etc.
• OUTPUT UNIT
• Printers, Monitors, LCD etc.
• PROCESSING UNIT
• CPU (CU + ALU)

05-01-2018
Internal structure of Pentium
microprocessor

The very first microprocessor had


a 100KHz clock, whereas the
Pentium Pro uses a 200MHz
clock, which is to say it ticks 200
million times per second.

05-01-2018
Fig4. Structure of microprocessor
Problem Solving
• Problem - An obstacle which makes it difficult to achieve a desired
goal, objective or purpose.
• Solving problem is the core of computer science
• Programmers must first understand
• how a human solves a problem,
• then understand how to translate this "algorithm" into something
a computer can do,
• and finally how to "write" the specific syntax (required by a
computer) to get the job done.

05-01-2018
Problem Solving Process
1. Define the problem
2. Analyze the problem
3. Generate possible solutions to the problem
4. Analyze the solutions
5. Select the best solution(s)
6. Implement the solution

05-01-2018
Algorithms & Flowcharts
• Tools a software developer uses when creating new programs.
• Algorithm - step-by-step recipe for processing data.
• Flowchart - graphically represents the steps a program or set of
programs takes to process data.
• With algorithm and flowchart, we can easily understand a program.

05-01-2018
Symbols used in flowchart
Oval shaped symbol is used to denote the start/end
of program
This symbol is used to show the I/O performed

This symbol is used to show the process

This symbol represents the point where decision is


made
This symbol is used to show the I/O performed

Oval shaped symbol is used to denote the start/end


05-01-2018 of program
Programming Machines
• A program is a set of instructions used to control the behavior of
a machine, often a computer (in this case it is known as a computer
program).
• Examples of programs include:
• A computer program list of instructions to be executed by a
computer.
• Barrels, punched cards and music rolls encoding music to be
played by player pianos, fairground organs, barrel
organs and music boxes.

05-01-2018
Machine Language
• Set of instructions executed directly by a computer's central
processing unit (CPU).
• Each instruction performs a very specific task, such as a load, a jump,
or an ALU operation on a unit of data in a CPU register or memory.
• Every program directly executed by a CPU is made up of a series of
such instructions.

05-01-2018
What is Programming?
Learning to program means
learning how to solve problems using code.
• Instructing a computer to do something with the help of a
programming language.
• In programming we deal with three kind of things:
• Data
• Procedures
• Program

05-01-2018
Steps in Program
Development
1. Define the problem
2. Outline the solution
3. Develop the outline into an algorithm
4. Test the algorithm for correctness
5. Code the algorithm into a programming language
6. Run the program on computer
7. Document and maintain the program

05-01-2018
Discipline in Programming
• An undisciplined developer will not be able to ship on time and will
not write code that is easy to maintain.
• A disciplined developer will not only enable the success of a project,
but will raise the level of productivity in others.

05-01-2018
Good Program v/s Bad
Program
• If program produces what is required, and is correct in its output,
then is this a ‘good’ program.
• Program executes successfully for n number of test cases.
• Characteristics of good program include:
• Run-time efficient
• User Friendly
• Self Documenting code (uses meaningful names for identifiers)
• Portable
• Reusable
• Robust (can handle unexpected conditions)

05-01-2018
Good Program v/s Bad
Program
• Characteristics of bad program:
• Messy, unreadable code
• Bugs, bugs everywhere
• Not well tested
• No documentation / comments
• Not well organised
• No indentation
• No robustness

05-01-2018
FAQs
• Explain the functioning of a keyboard with diagram.
• Explain the functioning of a mouse.
• How a computer performs decision making?
• What are the types of dynamic RAM?
• What is eMMC chip?
• What is the difference between DDR, DDR2, DDR3, DDDR4?
• Draw a flowchart to find average of two numbers.

05-01-2018

Das könnte Ihnen auch gefallen