100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Introduction To Programming $5.49   Add to cart

Class notes

Introduction To Programming

 3 views  0 purchase
  • Course
  • Institution

"Introduction to Programming (C and C++)" is a comprehensive course designed for beginners to learn programming fundamentals. This course covers: - Basic programming concepts and syntax - Variables, data types, and operators - Control structures (if/else, loops, switch) - Functions and poin...

[Show more]

Preview 4 out of 563  pages

  • September 20, 2024
  • 563
  • 2024/2025
  • Class notes
  • Professor muhammad muneeb
  • All classes
avatar-seller
Introduction to Programming CS201

,CS201 – Introduction to Programming




Lecture No. 1 .................................................................................................................3
Lecture No. 2 .................................................................................................................9
Lecture No. 3 ...............................................................................................................15
Lecture No. 4 ...............................................................................................................24
Lecture No. 5 ...............................................................................................................33
Lecture No. 6 ...............................................................................................................45
Lecture No. 7 ...............................................................................................................55
Lecture No. 8 ...............................................................................................................66
Lecture No. 9 ...............................................................................................................77
Lecture No. 10 .............................................................................................................88
Lecture No. 11 .............................................................................................................99
Lecture No. 12 ...........................................................................................................112
Lecture No. 13 ...........................................................................................................124
Lecture No. 14 ...........................................................................................................143
Lecture No. 15 ...........................................................................................................158
Lecture No. 16 ...........................................................................................................171
Lecture No. 17 ...........................................................................................................186
Lecture No. 18 ...........................................................................................................198
Lecture No. 19 ...........................................................................................................211
Lecture No. 20 ...........................................................................................................228
Lecture No. 21 ...........................................................................................................245
Lecture No. 22 ...........................................................................................................255
Lecture No. 23 ...........................................................................................................269
Lecture No. 24 ...........................................................................................................279
Lecture No. 25 ...........................................................................................................292
Lecture No. 26 ...........................................................................................................305
Lecture No. 27 ...........................................................................................................319
Lecture No. 28 ...........................................................................................................329
Lecture No. 29 ...........................................................................................................345
Lecture No. 30 ...........................................................................................................359
Lecture No. 31 ...........................................................................................................369
Lecture No. 32 ...........................................................................................................382
Lecture No. 33 ...........................................................................................................395
Lecture No. 34 ...........................................................................................................408
Lecture No. 35 ...........................................................................................................422
Lecture No. 36 ...........................................................................................................433
Lecture No. 37 ...........................................................................................................444
Lecture No. 38 ...........................................................................................................454
Lecture No. 39 ...........................................................................................................469
Lecture No. 40 ...........................................................................................................482
Lecture No. 41 ...........................................................................................................497
Lecture No. 42 ...........................................................................................................510
Lecture No. 43 ...........................................................................................................520
Lecture No. 44 ...........................................................................................................529
Lecture No. 45 ...........................................................................................................553




2
© Copyright Virtual University of Pakistan

,CS201 – Introduction to Programming



Lecture No. 1

Summary
o What is programming
o Why programming is important
o What skills are needed
o Develop a basic recipe for writing programs
o Points to remember

What is programming
As this course is titled “Introduction to programming”, therefore it is most essential
and appropriate to understand what programming really means. Let us first see a
widely known definition of programming.

Definition: "A program is a precise sequence of steps to solve a particular problem.”

It means that when we say that we have a program, it actually means that we know
about a complete set activities to be performed in a particular order. The purpose of
these activities is to solve a given problem.

Alan Perlis, a professor at Yale University, says:

"It goes against the grain of modern education to teach children to program. What fun
is there in making plans, acquiring discipline in organizing thoughts, devoting
attention to detail and learning to be self-critical? "

It is a sarcastic statement about modern education, and it means that the modern
education is not developing critical skills like planning, organizing and paying
attention to detail. Practically, in our day to day lives we are constantly planning,
organizing and paying attention to fine details (if we want our plans to succeed). And
it is also fun to do these activities. For example, for a picnic trip we plan where to go,
what to wear, what to take for lunch, organize travel details and have a good time
while doing so.

When we talk about computer programming then as Mr. Steve Summit puts it

“At its most basic level, programming a computer simply means telling it what to do,
and this vapid-sounding definition is not even a joke. There are no other truly
fundamental aspects of computer programming; everything else we talk about will
simply be the details of a particular, usually artificial, mechanism for telling a
computer what to do. Sometimes these mechanisms are chosen because they have
been found to be convenient for programmers (people) to use; other times they have
been chosen because they're easy for the computer to understand. The first hard thing
about programming is to learn, become comfortable with, and accept these artificial
mechanisms, whether they make ``sense'' to you or not. “



3
© Copyright Virtual University of Pakistan

, CS201 – Introduction to Programming


Why Programming is important

The question most of the people ask is why should we learn to program when there
are so many application software and code generators available to do the task for us.
Well the answer is as give by the Matthias Felleisen in the book ‘How to design
programs’

“The answer consists of two parts. First, it is indeed true that traditional forms of
programming are useful for just a few people. But, programming as we the authors
understand it is useful for everyone: the administrative secretary who uses
spreadsheets as well as the high-tech programmer. In other words, we have a broader
notion of programming in mind than the traditional one. We explain our notion in a
moment. Second, we teach our idea of programming with a technology that is based
on the principle of minimal intrusion. Hence, our notion of programming teaches
problem-analysis and problem-solving skills without imposing the overhead of
traditional programming notations and tools.”

Hence learning to program is important because it develops analytical and problem
solving abilities. It is a creative activity and provides us a mean to express abstract
ideas. Thus programming is fun and is much more than a vocational skill. By
designing programs, we learn many skills that are important for all professions. These
skills can be summarized as:
o Critical reading
o Analytical thinking
o Creative synthesis

What skills are needed

Programming is an important activity as people life and living depends on the
programs one make. Hence while programming one should

o Paying attention to detail
o Think about the reusability.
o Think about user interface
o Understand the fact the computers are stupid
o Comment the code liberally

Paying attention to detail
In programming, the details matter. This is a very important skill. A good programmer
always analyzes the problem statement very carefully and in detail. You should pay
attention to all the aspects of the problem. You can't be vague. You can't describe
your program 3/4th of the way, then say, "You know what I mean?'', and have the
compiler figure out the rest.

Furthermore you should pay attention to the calculations involved in the program, its
flow, and most importantly, the logic of the program. Sometimes, a grammatically
correct sentence does not make any sense. For example, here is a verse from poem
"Through the Looking Glass" written by Lewis Carol:

4
© Copyright Virtual University of Pakistan

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller muhammadmuneeb2. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75619 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.49
  • (0)
  Add to cart