Sunteți pe pagina 1din 10

1 - HELLO, C!

UNIT - 1
Complete
Details
Module
No. : 1 (1/4)

Chapter
No. :

Unit No. : 1 (1/20)
Video Lecture Duration : 96 Minutes

CONTENTS

* 10 Guidelines for Mastering Programming Skills


* Virtual Classification of Students
1.0 Intro
1.1 Understanding Computer Program
1.2 Human Programme and Computer Program
1.3 Human Programme vs. Computer Program - Comparision
1.4 Function - Oriented Programming (FOP) Approach

7
2 1 - HELLO, C!

10 GUIDELINES
For Mastering Programming Skills

Maintaining a specific discipline is an essential requirement for mastering programming languages


and acquiring programming skills because these are different type of studies from others. I am
providing 10 guidelines to maintain such discipline.
A first impression is an ever-lasting impression, which may either be good or bad. This principle is
applicable not only to the real world things but also to our programming studies. In detail, if you
get a first (good) impression on a subject, the scope of acquiring proficiency over the subject is high.
If you think analytically, in order to get a good impression on a subject, a good beginning is a must.
It is said that, “A good beginning is a half-ending”. In order to have a good beginning, you should
overcome the initial hurdles, known as starting troubles, which normally arise when we initiate
any new job.
The C language is the golden threshold to enter the programming world. I strongly trust that if
you get a good impression on C language, your chances of learning and mastering not only C but
also the advanced languages such as C++, Java, C# etc., are high.
That’s the reason, I am providing a great impression on C language just with a couple of days of
your study in this book. Believe me and proceed. I assure you that, you will be able to write solid C
programs formally, in the first week of your study. If you can’t believe it, make a simple trial and
experience it on your own.

Understand the underlying spirit of the following guidelines and strictly adhere to them-

1. Follow WRaP order


The acronym WRaP stands for Watch Read and Practice. First watch the video lectures;
this is equivalent to attending classroom lecture. Next read every concept thoroughly.
Then you will be perfect over the concepts and acquire conceptual knowledge. Then practice
the corresponding programs. Consequently, your knowledge is transformed into skills.
Remember that in the Application-Oriented studies, acquiring skills is the ultimate
destination.

2. Reading and Writing habits


Don’t avoid reading and writing. These are very natural ways of learning and mastering
subjects. Reading habit enables you to improve your imagination power whereas writing
habit enables you to own the concepts. Simple watching does not provide these capabilities.

3. Avoid random and precise study


As this is a true career-oriented study, strictly avoid your college-oriented habits, namely
study only important concepts and study precisely. You must remember one thing; in
application-oriented studies, each and every concept in the subject is equally important.
Illustratively, if a subject is like a toolkit, each concept is like a tool in it. We can’t ignore
any tool in a toolkit.

4. Only after owning the current concept, proceed to the next


Once you feel that you have owned a concept, then proceed to the next. What is the yardstick
for “owning”?

2
1 - HELLO, C! 3

If you acquire such a confidence that you can explain the concept to others, it is the ultimate test. If
possible, you may try it.

5. Before watching the lectures, take the printout


In these video lectures, most concepts are explained through the programs. If you have to understand
the concept thoroughly, referring the corresponding program is a must. So take the printout and
refer it, while watching the corresponding video lectures.

6. Pass the unit-test before proceeding to the next unit


We are providing the First-of-its kind Monitoring system through our ELMS
(Ekalavya Learning Management System), which enables you to monitor and master every one
hour of your study. For this purpose, we dissected all the courses into ONE-HOUR study units,
and for each such unit, we furnish 3 elements: Ebook, Video Lectures and the Unit Test. So, start
your study right from the first unit and study, practice, write and pass the unit test. Then only you
have to proceed to the next unit. Consequently, you can transform every day as a productive day.

7. Prepare your weekly study plan and Strictly adhere to it


You may be either a college-goer, office-goer or a job seeker. So the amount of time you spare for
these studies is different from one person to another.That is why, you must make out a pragmatic
study plan, preferably for a week and strictly adhere to it. Then only you can finish this course in a
scheduled period.

8. List out all the doubts and get answers for them
A doubt is an obstruction in our studies. If a student gets doubts frequently, obviously he/she will
lose interest in the subject. That is why, we developed this course as 100% doubt free. Inspite of it,
if you get any doubt, list it out and find the answer at the earliest. You may feel free to mail us for
any clarifications.

9. Focus on the Project Zone


The ultimate objective of all programming studies is acquiring programming skills. In order to
enable you to acquire such skills, we designed and developed this project zone. This is divided into
three levels: Entry-level, Advanced-level and Real-Time. You need not wait till the completion of
the course for developing projects. After completion of every module, you will be capable of developing
the corresponding level of projects. This strategy enables you to transform your conceptual knowledge
into corresponding programming skills instantly.

10. Focus on the Interview Pool


If you are a career aspirant, normally without facing an interview, you may not get a job. Whatever
you learnt in years, may be tested within a fraction of an hour in an interview room. If you fail to
satisfy the interviewer, all your knowledge and skills are undermined. In fact, answering
interviewquestions is a special technique which requires a special focus and training that we are
providing through our Interview Pool.

All these guidelines enable you to shift from the college-oriented style of study to career-oriented
style of study. If you are a true aspirant of a bright Software career, strictly adhering to these
guidelines is a must.

3
4 1 - HELLO, C!

VIRTUAL CLASSIFICATION OF STUDENTS

You must remember that this is a true IT Placement Training program, but not one of your
college-training programs. The basic objective of this training program is to enrich your
Employability criteria, which is expected by the IT industry and Transform you as an
Industry-ready programmer.
Employability means Knowledge, Skills and Abilities (KSA) to acquire a suitable
employment and to maintain the same. You must know the clear meaning of the
Employability, before undergoing the training to acquire it. Illustratively, Knowledge is
like knowing the recipe of a dish, Skill represents the competence to prepare the dish and
Ability represents the competence to prepare the same dish with different tastes.
In college-oriented studies, the main focus of most of the students is on acquiring only
knowledge required for getting marks. In this approach, there is a little room for acquiring
skills. In order to accomplish abilities, acquiring the corresponding skills is a must.
In this scenario, for enriching the employability of students for transforming them into IT
Industry-ready programmers, we are classifying the IT career aspirants into two virtual
groups. They are:
1. Students (College-goers)
2. Graduates
Even though these two groups undergo the same placement training, their study-plans
should be different. Obviously as college-going students are busy with their college
schedules, I recommend a suitable plan for them. If they start this placement training
preparation just at the beginning of any semester holidays, they may concentrate exclusively
on this course for one month and can finish at least a minimum of 30% of the course. Above
that, they are well tuned up with the methodology of the training. And during the semester
period, if they continue their focus on this training, subject to the available time, they can
finish at least 45% of the training. They may finish remaining 25% of the course in the
semester vacation. If they are interested, they may prepare for the International Certification
exam namely OCAJP (Oracle Certified Associate Java Programmer). With this training,
they can well compete in the campus recruitment or any other and succeed.
For Graduates (of IT or non-IT), we have prescribed a 120-day careerSURE Finishing program
to acquire employability and evolve as the IT Industry-ready programmers. You may refer
the complete details of this program on our website.

4
1 - HELLO, C! 5

1. HELLO, C!

Congratulations to all of you for stepping into the programming world. In fact, C is the
golden threshold for entering into the programming world, because C was evolved as the
first general-purpose language and it provided building blocks for the many advanced
languages such as C++, Java, C#, Python etc. In my view, illustratively the command over
C acts as the foundation and the ground floor of multi-storied (programming) building. As
you are aware, once laying foundation and the construction of ground floor are finished, the
super stories can be built with lot of speed and ease.

Not only teaching programming languages, but also I want to teach many techniques, which
are useful for mastering them with ease and time-saving, contextually. In fact, these are
management techniques, which are aptly modified to suit for our programming studies.
Understand the real spirit of these techniques and implement them properly.

The first one is the Quantitative Technique. Before taking up any big task, first quantify the
entire job and devise your implementation plan, subject to all your strengths and limitations.
Let us apply this first technique to our C training.

Quantification Report

Title of the Book : C ALLCLEAR

No. of Pages : 1000

No. of Chapters : 20

No. of Concepts : 300

No. of Concept-wise Programs : 500

No. of Projects : 50

Keeping this report in view, you study for one week and appraise your Weekly productivity.
Based on that, you can prepare the time plan, for the entire C training. And this helps you
not only for maintaining a study discipline but also for completing your program according
to your pre-defined time-plan.

The second technique is MBO (Management By Objectives). In a nutshell, the underlying


principle of this is to utilize all your resources positively for achieving your task. If any one
or more of the resources are working adversely or negatively, they should be controlled or
their effect minimized. In detail, in order to complete this placement training successfully
in time, you must require some resources, namely Attitude, Study material, Computer,
Guidance and Support, Time, Health, Study environment etc. You must take care that all
these resources work positively for achieving your task. If you find any adversity, you must
correct it or control it. If you understand the real spirit of these techniques and implement
them, you can manage your career according to your aspirations.

5
6 1 - HELLO, C!

At a Glance....

At the Outset, I want to explain the programming basics. This knowledge helps
you a lot to understand the concepts, which we will discuss in the next units,
smoothly. And also this knowledge prevents the probable doubts arise in you
study as well as in applications.
A doubt is an obstruction in our study. If several doubts are accumulated and
remained uncleared, the student loses interest in the subject. "Prevention is
better than Cure". As a preventive measure, I am introducing a set of relevant
programming basics in this first Unit. That's the reason, you must study these
basics thoroughly, before moving to the next unit.
You must remember that the knowledge of the relevant basics helps you to
understand and own a concept, whereas a concept provides the blueprint for the
corresponding applications. By ignoring concepts, if you take up applications,
you never be comfortable in developing applications. Your style of working will
be always similar to "Blind Man's Walk".
Through this Workshop, you will experience a Weekend Wonder. Don't try any
shortcuts in this study. Always Remember:

Going Tough - Tough Going.

6
1 - HELLO, C! 7
1.1 UNDERSTANDING COMPUTER PROGRAM

A Computer performs all our Computational tasks, strictly according to our instructions. We
make a set of computer instructions, as a bundle, and feed it to a computer. Such a set (bundle)
of instructions is called a Computer Program.
Computer Program-Definition
A Computer program is:
i. a set of computer instructions,
ii. which manipulates a set of given data,
iii. to achieve a pre-defined task and
iv. which is executed on a computer.
Understand this definition through the following example:
a) Task of the program : To Prepare and Print a Marks Report of a Student
b) Set of Instructions i. Start the Program
ii. Read the Marks of 5 papers from keyboard
iii. Add the Marks of 5 papers (Finding the Total Marks)
iv. Calculate the Average Marks
v. Display the Marks Report
vi. Stop the Program
c) Set of Data: Marks in 5 Papers
With this example, you can understand the meaning and purpose of a computer program.
The set of instructions (6 nos.) acts upon a set of data (i.e.: Marks in 5 papers), to achieve the
pre-defined task (i.e. preparing and displaying marks report). This program is executed on a
computer, as it is a computer program. As a computer program is like a human programme,
similar names (i.e. Program and Programme) are given to these terms. Therefore, if you
understand every concept in the programming from the real life angle, you can understand
the concepts and own them easily. Since the concepts provide blueprints for the corresponding
applications, conceptual understanding enables you to master programming and achieve the
corresponding skills.

Note that concepts act like blueprints for the programs. So, by understanding concepts well,
you can write programs well. By writing programs well, you can own the corresponding
concepts. Therefore, understand that concepts and the corresponding programs are
complementary sources to master programming.

1.2 HUMAN PROGRAMME AND COMPUTER PROGRAM


A human programme is a set of Activities, which are implemented by humans, whereas a
computer program is a set of Instructions, which are implemented by a computer. Since a
computer is like our assistant, we instruct it. By comparing computer program with human
programme, we can understand certain facts, which are essential for our study. At first, you
must understand one fact; most computer concepts and systems are designed based on real
world models only. A computer program is also modeled on a human programme.
Every day we implement several programmes, to achieve different daily tasks. For example,
attending college, completing home work, purchasing provisions etc., are some of our daily
programmes, we routinely perform every day. If you analyze each and every programme in
this list, each one is the composition of several activities. They are just like the instructions
in a computer program, as explained above.
8 1 - HELLO, C!
Algorithm: A set of well-defined steps (or procedures) required to implement a program, is
called an Algorithm (e.g.: 6 steps listed in the previous concept).
Now let us see an algorithm for a human programme.
For example, you instructed your assistant, “Withdraw Cash from the Bank”, by giving a cheque
to him. Now let us analyze this Programme. You have given only one instruction to your assistant
as to, “Withdraw Cash from the bank”. Treat this as a program (me), and analyze it logically and
dissect it into steps to be performed. He has to implement the following steps sequentially:

i. Take the Cheque


iii. Go to the Counter
iv. Give the Cheque
v. Collect Cash
vi. Count the Cash
vii. Keep it safely
viii. Return to the Office
ix. Give it to you

There are nine steps totally. It means, in order to achieve the task of the program(me), your
assistant implemented 9 steps sequentially. Notice that a computer program is almost similar,
and implemented the algorithm (series of steps) to perform the tasks, say Printing Marks Report.

1.3 HUMAN PROGRAMME vs. COMPUTER PROGRAM - COMPARISON

By comparing a human programme with a computer program, you can find the following
differences:
i. Medium
Your medium of language and your assistant’s medium are same. That’s way, your assistant
could understand your instruction. Since a computers can’t understand a human language,
various computer languages were created, in order to enable us to interact with computers.
Therefore, we should learn a computer language, such as C, C++, or Java, in order to instruct
a computer or for writing computer programs. As you know, a program is nothing but a set of
computer instructions.
ii. Brain
Even though you have given a simple and single-line instruction orally, or sometimes through
your behavior to your assistant, he can analyze it, develop algorithm (sequence of steps),
implement them sequentially, perform the job, and ultimately achieve the task of the programme.
He can do all this, because of his BRAIN and its analytical power. Note that his Brain itself can
understand the instructions, develop the algorithm, convert all steps in the algorithm as the set
of instructions (like a program or software), and send them to the corresponding limbs (like
hardware), and got the programme performed.
As Computer is a brainless machine. But it has a unique capability to implement programs (set
of Instructions) accurately. So, we have to develop algorithm, convert it into a program (software),
and give it to a computer, to a implement the program.
1 - HELLO, C! 9
iii. Speed
An ordinary computer can perform its jobs millions of times faster than a human being.
Whatever amount of computational jobs, a person can perform within a year, that amount of
job can be performed by an ordinary computer, within minutes, without any mistakes.
iv. Mistakes
If your program contains any logical mistakes, the computer can neither identify them nor
rectify them, and implements the program with those shortcomings only, because it has no
discretionary power. Whereas your assistant may rectify your mistakes if any, as he has brain,
as well as discretionary power. But if you write your computer program without any
shortcomings, computer never commits any mistakes, and it implements it accurately, whereas
your assistant may commit mistakes, because he is a human, obviously ‘err is human’.
Understanding of the real spirit of this concept enlightens you as to what extent you can
depend on the computer, subjected to its limitations.
1.4 FUNCTION-ORIENTED PROGRAMMING (FOP) APPROACH
C is a Function-Oriented Programming (FOP) language. That means, every C program is
developed as the composition of a set of functions. Every C function is represented with an
identifier and a set of parenthesis. E.g.: main( ), sqrt( ), clrscr( ). Normally a function's name
(identifier) represents, what that function does. For example, the main( ) function is the 'Main',
means, acts like the 'Manager' of a program. The sqrt( ) function calculates the square root of the
given value to it, as an argument. E.g; sqrt(100) is 10.
The simplest and valid C Program is main () { }
This is the smallest C program. No doubt, this is a valid C program, and its task is
doing nothing. “Do Nothing” is a valid task for a C Program. But, in real life, 'Do – nothing’ is not
at all considered as a valid activity In certain situations, a program should be in “Do Nothing”
state for some time. That means, it should work, without doing anything.
Understand that every function in a C program, is like a specialist in our real life, such as a
carpenter, an electrician, a mechanic, a painter etc. The C functions (specialists) perform jobs,
such as Receiving data from the keyboard (called as Reading), Displaying data on the monitor
screen (called as Writing), Clearing data written on the monitor output screen (acting as a
black board Duster), Calculating the square root of a given number etc., For any function, beside
its name, a pair of parenthesis must be written. E.g: main( ), scanf( ), printf( ), clrscr( ), sqrt( ).
main( ) Function:
The main( ) function acts like the manager of a program. Without a manager, there is no office.
Similarly, without main( ), function, there is no C program. So, the main( ) function is a
compulsory function in a C program. This means, we can’t write a C program without a
main( ) function. The execution of a C program starts from the main( ) function only, as this is
the entry point of a program. These are only the specialities of the main( ) function. Except
this, the main( ) function is also like any other C function, by all means.

The C's Function-oriented model is just like real life model, which we adopt in our daily life.
You are the Manager of your house. If you want to get your house cleaned, you call a specialist
named Cleaner. If you want to get your house painted, you call two specialists: Painter and
Cleaner. If you want to get your house shifted, you call three types of specialists: Packers,
Lifters and Movers. If you have to get a house constructed, you call many specialists such as,
Architect, Engineer, Manson, Transporter, Labourers,Carpenter, Electrician, Plumber, etc. As
the main( ) is the manager of a C program, it acts exactly like you, as explained above. More
specifically, depending on the task of the program, the main( ) function calls various other
functions and each such function performs its subtask. Ultimately the main( )'s task is
performed, by collective contribution of all such function.
10 1 - HELLO, C!

A FOP model C program should be written in the following manner


/* TASK OF THE PROGRAM: Printing a Marks Report */
main( ) //Manager - calls Several Functions
{ //Beginning of the Office
read_marks( ); //Function Reads (receives marks)
total_marks( ); //Function Calculates Total marks
average_marks( ); //Function Calculates Average Marks
print_report; //Function Prints Marks Report
} //Ending of the Office

Just study the model. Is it not like the real-life model?

Note that from the day-one, you can't write your C programs in the Function-oriented model,
as shown above. After learning many concepts and writing all types of statements, you will
be able to write your programs in the Function-oriented model.
Examine one more example of the FOP model. If you have to write a program to print the
Cash Bill of a Hotel, it is to be written with the following list of functions.

main( ) /*Manager Function*/


{ /* Beginning of the Program */
print_menu( ); /* Function Prints Menu with the Item-with Rates */
print_caption( ); /* Function Prints the Caption of the Bill*/
read_items( ); /* Function Reads the items ordered by the customer*/
itemized_total( ); /* Function to Calculate the Itemized total */
grand_total( ); /* Function to Calculate grand total of the Bill */
print_bottomline( ); /* Function prints Thank you */
print_Bill( ); /* Function prints Entire Bill */
} /* End of the program */

Note that, these examples are given, just for the understanding FOP Model. At this stage,
don't think about the complexity involved in writing the same program. Just within a few
days, you will be able to write programs exactly in the Function-Oriented Model. Believe me.
So far, we have learnt the basic concepts of a computer program and Function-oriented
Programming (FOP) approach. Now, let us start writing our first C program.

S-ar putea să vă placă și