Class notes DSA: Intro to Programming & Flowcharts
0 keer bekeken 0 keer verkocht
Vak
DSA: Intro to Programming & Flowcharts
Instelling
DSA: Intro To Programming & Flowcharts
In this Document, we will understand the Basics of Programming, we will create a lot of Flowcharts, also try some pseudo codes.
There is a lot to learn, Keep in mind “ Mnn boot karega k chor yrr apne se nahi yoga ya maza nahi para, Ask 1 question “ Why I started? “
Intro to Programming & Flowcharts
We will learn about flow charts, pseudocode, and programming languages. We will also learn about
programming languages and why we use them. After this, we will write our program. This will be our
flow whenever we solve any problem. First question, then given values, then approach and at last we will
code it. Bhaiya explains that a flowchart is a diagrammatic approach of that approach known as a flow
chart. The flow chart constitutes various components, connected with each other Bhaiyan says. He says
that from where a program is starting we have a component called the terminator. Terminator is used to
showing the start and end start of the program. The next block is a simple rectangle, which shows a
process. Bhaiya explains how to make a flowchart for the sum of 2 numbers. He says the pseudocode as a
whole is a generic way of representing logic. The flow of a flow chart is the same as the flow of the
components of the flow chart. We use a parallelogram to show the input/output of the program.
We want to make a flowchart for calculating simple interest This is the formula for the simple interest
You must have studied it in your school We started our program from this start block I don't know p, r, t,
so I need to take them as inputs first So I asked a user to give me the values for p, r, and t So now I have
P, R, and T So I made this rectangular block for the calculation part Here I wrote this formula After
finding this answer in the above calculation, I have to print the output too So here I will print output with
this block print SI and then we will end this program We started the program, took a, b as input then we
checked whether a is less than b or not. If a < b prints `` YES '' else print `` NO '' and it's done simply You
just have to write in English what you are thinking and it is called pseudocode. If any number has 2 as its
factor, then it is an even number or ODD number. We have to check a condition that whether N is ODD
or EVEN, so we will make one block for this condition Here is the decision-making block, Is N % 2 = 0?
We will get 2 outputs, YES or NO If the output is YES, then it is an EVEN number, so I printed ODD
Else, I will print ODD Then I made this end block and ended this program something like This is the
flowchart for EVEN, ODD Got it right? Bhaiya, why are you putting these inverting commas again and
again, you will come to know soon.
We have to print something and then increment too You have to Print and then increase the printed
number too You can see here, we printed and then increased the number by 1 But we do n't know how to
do it How we will increase again and again Let's rub it You know that we have to start from 1 and print
till 5 So if I give you a number which starts from 1 to 5, will it work? You are like, yes, this is what we
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper amangupta. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €8,35. Je zit daarna nergens aan vast.