Anda di halaman 1dari 13

College of Science

Comp 211 : Programming in C


Module Study Guide
Academic Year 2017/2018
November 2017
Contents
COMPUTER SCIENCE 211 ....................................................................................................................... 3
MODULE OUTCOMES .............................................................................................................................. 3
MODULE COORDINATOR ........................................................................................................................ 4
HOW TO SEEK ASSISTANCE ..................................................................................................................... 4
WORK SCHEDULE .................................................................................................................................... 4
DETAILED MODULE LEARNING UNITS ................................................................................................. 5
PRACTICAL PROGRAMS ....................................................................................................................... 6
COURSE MEETING TMES: ........................................................................................................................ 8
LEARNING MATERIAL .............................................................................................................................. 9
PRESCRIBED TEXTBOOK: ..................................................................................................................... 9
RECOMMENDED TEXTBOOK: .............................................................................................................. 9
OTHER LEARNING MATERIAL .............................................................................................................. 9
MODULE ASSESSMENT ......................................................................................................................... 10
CRITERIA ............................................................................................................................................ 10
CONTINUOUS ASSESSMENT (35%)................................................................................................ 10
FINAL EXAMINATION (65%) .......................................................................................................... 10
SUBMITTING ASSESSMENTS ............................................................................................................. 10
LATE WORK ................................................................................................................................... 10
DULY PERFORMED (DP) REQUIREMENTS ............................................................................................. 10
LEAVE OF ABSENCE ........................................................................................................................... 11
BEHAVIOUR IN CLASS ............................................................................................................................ 11
LECTURES AND LAB SESSIONS............................................................................................................... 11
SAFETY IN THE LABORATORY ................................................................................................................ 12
ACADEMIC MISCONDUCT ..................................................................................................................... 12
PLAGIARISM ...................................................................................................................................... 12

Page 2 of 13
COMPUTER SCIENCE 211

Programming in C is a core module for all the undergraduate degree programmes. It serves as an
entry level programming module, and aims to introduce the skills required to write simple
structured programs in a high-level language and assess these skills in practical situations.

The core principles considered key in this module are those which underpin a practical ability to
write code: data and data structures, structured code, subroutines, parameters, loops, input/output
and files. The emphasis however, is on the creation of simple programs based on common patterns
found in software – data items, collections of items, iteration over collections and persistence.
Students learn about fundamental procedural programming concepts such as data types, operators,
expressions, flow of control and program structure. While students are encouraged to explore
additional language features themselves, instruction in the module relies on a minimalist subset of
the C language that is adequate to complete significant programming tasks

MODULE OUTCOMES
A student who successfully completes the course will have the ability to:

1. Understand the basic terminology used in computer programming


2. Be able to utilize the new skills acquired to analyse and solve problems using the C
language.
3. Write, compile and debug programs in C language.
4. Use different data types in a computer program.
5. Design programs involving decision structures, loops and functions.
6. Explain the difference between call by value and call by reference
7. Understand the dynamics of memory by the use of pointers.

Page 3 of 13
MODULE COORDINATOR
Your module coordinator will be the main contact person for the module. The coordinator will be
available to assist you in anything concerning the module or refer you to an appropriate staff
member who will assist you.

The Coordinator for this module is: Dr.Rajalakshmi Selvaraj

Dr Rajalakshmi Selvaraj (Senior Lecturer)


Office: Block : 1, room : 4
E-mail address: selvarajr@biust.ac.bw

HOW TO SEEK ASSISTANCE

If at any point during the course of the module you need help, you are to contact the module
coordinator preferably by email. The Coordinator shall assist you or direct you to the appropriate
staff member.

Email will be used most for communication. It is the responsibility of all students to make sure their
email is functional and they check it regularly. All students should make sure they have access to
blackboard.

WORK SCHEDULE
Study Week # Date Week Theme/Topic Teaching/Assessment
Beginning Method
1 20th November House Keeping Theory/Practical

Introduction to C
Programming

2 27th November Structured Program Theory/Practical


Development in C
3 4th December

4 11th December C Program Control Theory/Practical

5 8th January

6 15th January C Functions Theory/Practical

7 22nd January

8 29thJanuary C Arrays Theory/Practical

9 12th Feburary

Page 4 of 13
10 19th Feburary C String Functions & Theory/practical
Introduction to
11 26th Feburary Structures
12 5th March Introduction to Theory/Practical
Unions

DETAILED MODULE LEARNING UNITS

Introduction to C Programming

 Input-Process-Output
 Programming language
 Compiler
 Algorithm
 Flowchart
 Pseudo code
 Variable and constant
 Data types
 Operators
 Simple C program : printing a line of Text, adding Two integers

Structured Program Development in C

 Simple if selection Statement


 if-else selection statement and nested if selection statement
 Switch selection statement.
 nested control structures
 Increment and decrement structures.

C Program Control

 Repetition essentials
 counter controlled repetition
 The loop constructs: while repetition statement
 for repetition statement
 do … while repetition
 break and continue statements
 Logical operators.

C Functions

Page 5 of 13
 General
 Function Declaration
 Function definition and function call.
 Arguments and parameters
 parameter passing conventions.
 Pass-by-value and pass-by-reference.
 Recursion.

C Arrays

 Array Basics
 Declaration and initialisation of arrays.
 Single dimensional arrays
 Multidimensional arrays
 Arrays Manipulation

C String Functions

 String manipulation functions


 String input and output functions

Introduction to structures and Unions

 Fundamental Concepts
 Basics of structures.
 Declaring a structure
 Creating a structure
 Operations on structures
 Structures and arrays.
 Unions.

PRACTICAL PROGRAMS

Week – 2 and 3: Lab Activities

S.No Programs
1. Write a C program to find area and perimeter of a rectangle
[Hint: area = length * breadth, Perimeter = 2(length + breadth)]

Page 6 of 13
2. Write a C program to calculate simple interest
3. Write a C program to swap two integers
4. Write a C program to accept 5 fraction numbers (floating point numbers) and find sum and
average of the numbers.
5 Program to convert temperature from degree centigrade to Fahrenheit

Week – 4 and 5: Lab Activities

S.No Programs
1. Program to find whether given no is even or odd
2. Program to find greatest in 3 numbers
3. Program to find that entered year is leap year or not
4. Write a C program to accept marks scored in a subject and print the result as below
If the marks scored is less than 35 print result as fail, if the marks scored is 35 and above
and less than 50 print the result as III class, if the marks is 50 and above and less than 60
print result as II class, if the marks is 60 and above and less than 85 print result as I class
and if the marks is 85 and above and less than 100 print the result as distinction. [Use if-
else statement]
5 Write a C program to do basic arithmetic operations on given two integers by accepting
the operator from the user. Use switch case statement to do this program.
[Hint: the given operator is +, then program should give sum of given two integers, if the
operator is – , then calculate difference, if operator is * then calculate product and if
operator is /, then calculate quotient
6 Program to use switch statement. Display Monday to Sunday

Week – 6 and 7: Lab Activities

S.No Programs
1. Write a C program to generate multiplication table for a given number.
2. Write a C program to find factorial of a number
3. Write a C program to find the sum of individual digits of a positive integer.

Page 7 of 13
[Hint: Given positive integer is 4557
[Sum of individual digits of a positive integer = 4+5+5+7=21]
4. Write a C program to generate first n natural numbers using for loop
5. Write a C program to generate first n Fibonacci numbers using while or for loop.
(Hint: Fibonacci series: 1 1 2 3 5 8 13 21 ……… n)
6. Write a C program to find whether the given no is palindrome or not by using while loop

Week - 8 : Lab activities

S.No Programs
1. Program to find factorial of a number using recursion
2. Program to show table of a number using functions.
3. Program to swap two numbers using functions
4. Program to show table of a number using functions.
5. Program to find square of a number using functions.

Week 9 and 10: Lab activities

S.No Programs
1. Write a C program to accept and print 1_D array.
2. Write a C program to accept and print 2_D array
3. Program to find sum of two matrices
4. Program to find subtraction of two matrices
5. Program to find multiplication of two matrices

Week – 11: Lab activities

S.No Programs
1. Write a c program to copy string using library function strcpy
2. Write a C program to concatenate strings
3. Write a C palindrome program to find whether the given string is palindrome or not
4. C Program to Store Information(name, roll and marks) of a Student Using Structure
5. C Program to Store Information of 10 Students Using Structure
6. C Program to Add Two Distances (in inch-feet) System Using Structure

Week – 12: Final Lab Test

Page 8 of 13
COURSE MEETING TMES:
Lectures: 2 per week (1 hour each)

Laboratories: 1 per week (2 hours)

Tutorial: 1 per week (1 hour)

LEARNING MATERIAL

PRESCRIBED TEXTBOOK:
1. Programming in ANSI C, by E. Balaguru Swamy. Tata Mc Graw Hill, ISBN No: 0-07-064822-0

REFERENCE TEXTBOOKS:
Title Author Publisher ISBN No

1 The C Programming Brian w. 2nd Edition 9780131103627


Language Kerningham, Dennis
M Riche Prentice hall

2 Let us C ( 8 th Edition) Yashavant P. Computer 9781934015254


Kanetkar Science
series

3 C: The Complete Herbert Schildt Mc Graw hill 078-


Reference, 4th Ed 3254031449

4 Programming in C (4th Stephen G. Kochan Pearson 978-


Edition) Education inc 0321776419

5 C How to Program ( Paul Dietel, Harvey Pearson 978-013-


6th Edition) Deitel Education 612356-9
,Inc

OTHER LEARNING MATERIAL


1. WWW is always a good source of information.
2. Other material on C programming in the library may also used

Page 9 of 13
MODULE ASSESSMENT
CRITERIA
Continuous Assessment will contribute 35% of the total score, with the other 65% from the Final
examination, to be written at the end of the semester

CONTINUOUS ASSESSMENT (35%)


This will comprise two quizzes, one practical test and one assignment:

Continuous Assessment Break down

Lab Tests: 15% Quizzes: 10% Assignment: 10%

Continuous Assessment Schedule

Quiz 1: to be held on week 4

Lab Test 1: To be held on Week 12 Quiz 2: to be held on week 8

Assignment: Issued on 12th of Feburary 2018, due week 9

FINAL EXAMINATION (65%)


The final examination written at the end of the semester will contribute 65% to the final mark.

SUBMITTING ASSESSMENTS
You may also be required to sign a declaration, stating that the assignment you have submitted is
truly your own work and not copied, plagiarized either from other you, textbook, encyclopedias,
journals or the internet. If it is discovered that you have breeched this declaration, a mark of zero
shall be given.

LATE WORK
Late submission of work will be penalised by a reduction of 10% off the awarded mark for every
working day that the assignment is handed in late. Thus if an assignment is 3 days late the awarded
mark will be reduced by 30%. After three working days the assignment will not be accepted and a
zero will be awarded. All lecturers and instructors will automatically enforce this procedure.

If you believe you have a valid reason for late submission you must provide documentary evidence
to the module coordinator before you miss a test or assignment

DULY PERFORMED (DP) REQUIREMENTS


A DP certificate must be earned in order for a student to write examination at the end of the course.
The requirements for the award of a DP are:

Page 10 of 13
i) Attendance at 95% of lectures, tutorials and practicals. All practicals and tutorials missed
without valid reasons will count towards the 5% that a student has missed.
ii) Continuous assessment of at least 40%. The CA mark is calculated from marks allocated
for performance during the course, assessed as listed above under “Continuous
assessment”. These will be published at the end of the module before the final
examination.
A list of those students refused DP certification shall be published on or before the last day of
teaching of the semester.

LEAVE OF ABSENCE
An attendance register will be taken for each class and to obtain your DP you will need to attend
95% of your classes.

It is, therefore, imperative to notify the College Manager if you know you will be absent, using the
appropriate form, at least one week in advance. The College reserves the right not to grant Leave of
Absence in advance.

If you miss classes it is important that you notify the College Manager by filling in the appropriate
form and submit it with documentary evidence of why you missed the classes e.g. a doctors note,
note from a clinic, or a letter from a close family member in the case of funerals.

If you do not adhere to these procedures you may be refused your DP or if you miss a test or
laboratory or assignment you will receive a mark of zero.

There will not be an opportunity for student to do practicals outside the scheduled practical times. If
you had a valid reason and wish to do a practical on a day other than that which you have been
allocated, you will need permission from the module coordinator to do so. Please note that it is your
responsibility to inform the module coordinator well in time in order to arrange this.

BEHAVIOUR IN CLASS
It is expected that students will behave in a manner which does not impede the ability of other
students to carry out their work in class. This includes: eating or drinking in class; any kind of noisy or
disruptive behavior this includes talking in lectures; using cell phones in any class is forbidden, this
includes receiving calls or sms or replying to calls or sending any kind of message; and the use of
iPODs or any other listening device. No audio or visual recording of any kind is allowed in any class. If
any behavior is deemed to be disruptive, the lecturer or instructor may ask you to leave the class
and any cell phone or other device confiscated. Any such behaviour will be reported and may be
acted upon through the Student Code of Conduct Regulations.

LECTURES AND LAB SESSIONS


Attending every lecture is crucial to learning the material necessary to complete the assignments
and practical programs. Handouts generally will not be provided in printed form. However, slides will

Page 11 of 13
be posted after lectures in the black board, and you are welcome to print them yourselves. Some
students may seek to take another course that overlaps with the lecture time and either come late
to lecture or leave early. This should be avoided, as it disrupts the lectures and distracts the rest of
the class. Please avoid interrupting the class by arriving late or leaving early.

The weekly laboratory sessions are mandatory to attend and it is expected that you will complete
the in-lab portions during the lab hours. Lab assistants will be in lab at the time to assist you and
verify that you have completed the in-lab exercises. Lab assistants are expected to encourage
students to use Linux computing environment present on the machines in the lab. Using a single
standardized development environment will make debugging easier and ensure consistent results
across machines.

SAFETY IN THE LABORATORY


This module comprises laboratory practical component. This will be carried out in the Computer
labs. It is therefore essential that everyone practices proper safety precautions. Please make sure
you refer to the module guidelines and laboratory handout on safety and the consequences of not
following safety precautions.

ACADEMIC MISCONDUCT
A student shall be guilty of Academic Misconduct if he or she breaches academic rules or
regulations, including false or fraudulent representation, cheating, plagiarism, intimidation, bribery
or attempted bribery, disruption of teaching, theft, copyright misuse and intellectual property theft;
possessing, using, or exchanging improperly acquired written or verbal information in the
preparation of laboratory work, a report, essay, examination, or other academic assignment;
unauthorised interaction with another student or students in the submission of academic
requirements, false claims for work submitted by a student, alteration of any academic grade or
rating so as to obtain unearned academic credit, forgery, alteration, or misuse of any University or
College document relating to the academic status of a student.

PLAGIARISM
Plagiarism Is a Serious Offence; the copying of other people’s work without full acknowledgement is
plagiarism and is regarded as a very serious offence in all contexts. The University regards this as a
particularly serious offence, which will be recorded on the academic record of any student found
guilty of plagiarism. Such a student will either be asked to sign an Admission of Guilt form or have
the matter referred to the Student Code Committee.

Following the signing of an Admission of Guilt form, the student’s name, student number and
offence are published on the University Notice System and any mark for the relevant assignment is
cancelled.

In serious cases, following a hearing in the Student Code Committee, the student may be excluded
from the University.

Page 12 of 13
There is an increasing tendency for students to find suitable internet sites and simply copy large
parts of these sites as their own work. This is easily detected. While students are encouraged to use
the internet, note that you are obliged to acknowledge your sources.

Page 13 of 13

Anda mungkin juga menyukai