Looping
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Comparing Selections and Loops

+12
Ferre
ellariana
Rhei
Lawrence
Pox
iramae
Louise Sebastiane Yagi
justjoking10
myramonique
Sean
James Navarro
daniella
16 posters
Go down
daniella
daniella
Admin
Posts : 42
Join date : 2018-07-24
Age : 25
Location : Dasmarinas City of Cavite
https://daniella.forumotion.com

Comparing Selections and Loops Empty Comparing Selections and Loops

Fri Jul 27, 2018 9:22 am
An important difference between a selection and a loop is that in the selection structure, the two logical paths that emerge from the decision join together following their actions. In the loop structure, the paths that emerge from the decision do not join together. Instead, with a loop, one of the logical branches that emerges from the structure-controlling decision eventually returns to the same decision.

Comparing Selections and Loops 310

For example, suppose your supervisor says, “If you don’t reach the end of the file when you are reading an employee record, display the record and read another one. Keep doing this until you run out of records.” Because the supervisor used the word if to startthe request, your first inclination might be to create logic that looks like Figure below.
Comparing Selections and Loops 410
Inefficient logic for reading and displaying employee records

The logic in Figure above works—each time an employee record is input and the eof condition is not met, the data is displayed and another record is input. However, the logic in Figure is flawed. First, if you do not know how many input records there are , the logic might never end. After each record is input, it is always necessary to check again for the eof condition. Second, even if you do know the number of input records, the logic becomes very unwieldy after three or four records. When you examine Figure , you see that the same set of steps is repeated. Actions that are repeated
are best handled in a loop.

The Figure BELOW shows a better solution to the problem.
The first employee record is input, and as long as the eof condition is not met, the program continuously displays and reads additional records.

Comparing Selections and Loops 510
Efficient and structured logic for getting and displaying employee records
James Navarro
James Navarro
Guru
Posts : 12
Join date : 2018-07-31

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Tue Jul 31, 2018 7:21 pm
Kumplikado na ng very light mga topics pero kinakaya pa naman hahaha, dito da topic na to mam naguguluhan nung isang araw pero thank you po dahil sa pagpost lessons dito mas nagets ko Smile

Sent from Topic'it App
avatar
Sean
Guru
Posts : 15
Join date : 2018-07-27

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Tue Jul 31, 2018 9:58 pm
may mga loop talaga na di natin alam na may mas maikli pa palang way .

Sent from Topic'it App
avatar
myramonique
Guru
Posts : 11
Join date : 2018-08-01

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Wed Aug 01, 2018 4:49 pm
Salamat ma'am! Kasi po nagagamit po namin yung forum na 'to as a guide para po mas mapalawak pa po namin yung kaalaman namin sa topic niyo. 💞

Sent from Topic'it App
avatar
justjoking10
Guru
Posts : 25
Join date : 2018-08-01

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Wed Aug 01, 2018 7:17 pm
Maam ang ganda po ng pag kaka explain very clear and very understandable. We just need to be careful about s nesting maam.
daniella
daniella
Admin
Posts : 42
Join date : 2018-07-24
Age : 25
Location : Dasmarinas City of Cavite
https://daniella.forumotion.com

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 02, 2018 8:58 am
Sean wrote:may mga loop talaga na di natin alam na may mas maikli pa palang way .

Sent from Topic'it App

LOOPS are the BEST to REPETITIVE TASK, when ang nag iiba lang ay data Cool
daniella
daniella
Admin
Posts : 42
Join date : 2018-07-24
Age : 25
Location : Dasmarinas City of Cavite
https://daniella.forumotion.com

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 02, 2018 8:59 am
justjoking10 wrote:Maam ang ganda po ng pag kaka explain very clear and very understandable. We just need to be careful about s nesting maam.

explain sa forum or discussion natin ? haha Laughing Careful , dapat observe talaga ang Loop Control Variable Smile)
daniella
daniella
Admin
Posts : 42
Join date : 2018-07-24
Age : 25
Location : Dasmarinas City of Cavite
https://daniella.forumotion.com

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 02, 2018 9:00 am
justjoking10 wrote:Maam ang ganda po ng pag kaka explain very clear and very understandable. We just need to be careful about s nesting maam.

yey! Thanks to Forumotion I love you Very Happy
avatar
Louise Sebastiane Yagi
Guru
Posts : 19
Join date : 2018-07-27

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 02, 2018 6:00 pm
Ma’am possible po ba sa if and sa else, parehong may loop?

Sent from Topic'it App
avatar
justjoking10
Guru
Posts : 25
Join date : 2018-08-01

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 02, 2018 7:19 pm
Louise Sebastiane Yagi wrote:Ma’am possible po ba sa if and sa else, parehong may loop?

Sent from Topic'it App

Pwede. If hinihingi ng problem mo.
avatar
iramae
Guru
Posts : 10
Join date : 2018-08-01

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Wed Aug 08, 2018 7:52 am
Sean wrote:may mga loop talaga na di natin alam na may mas maikli pa palang way .

Sent from Topic'it App

at kung malalaman niyo yung loop na iba ba, mas maganda ang program na magagawa ninyo.
avatar
iramae
Guru
Posts : 10
Join date : 2018-08-01

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Wed Aug 08, 2018 7:52 am
Good luck to Maam Daniella sa susunod pang discussion XD sana magawa na naten ng maayos XD GodBless Smile
James Navarro
James Navarro
Guru
Posts : 12
Join date : 2018-07-31

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 7:52 am
Maayos naman po maam pagkakadiscuss nyo po Smile Galing nyo nga po magexplain e hahaha Smile

Sent from Topic'it App
James Navarro
James Navarro
Guru
Posts : 12
Join date : 2018-07-31

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 7:52 am
Nakakakaba next lesson hahahaha

Sent from Topic'it App
James Navarro
James Navarro
Guru
Posts : 12
Join date : 2018-07-31

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 2:53 pm
daniella wrote:
justjoking10 wrote:Maam ang ganda po ng pag kaka explain very clear and very understandable. We just need to be careful about s nesting maam.

explain sa forum or discussion natin ? haha [smiley]https://2img.net/i/fa/i/smiles/icon_lol.gif[/smiley] Careful , dapat observe talaga ang Loop Control Variable [smiley]https://2img.net/i/fa/i/smiles/icon_smile.gif[/smiley])

Both yan maam hahahaha galing nyo po magturo Smile

Sent from Topic'it App
Pox
Pox
Guru
Posts : 11
Join date : 2018-08-11

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 6:33 pm
Structure pa rin po ba kahit wala ng boolean expression sa program?

Sent from Topic'it App
Lawrence
Lawrence
Guru
Posts : 11
Join date : 2018-08-11

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 7:09 pm
Louise Sebastiane Yagi wrote:Ma’am possible po ba sa if and sa else, parehong may loop?

Sent from Topic'it App
possible siya pre. kapag sa if decision mo kailangan ng loop kapag na meet na yung condition mo sa decision.
Lawrence
Lawrence
Guru
Posts : 11
Join date : 2018-08-11

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Sat Aug 11, 2018 7:10 pm
Pox wrote:Structure pa rin po ba kahit wala ng boolean expression sa program?

Sent from Topic'it App
pre pwede maging structured pag flowchart yung ginawa kaso walang patutunguhan. hahahaahha opinyon ko lang ehhe
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:20 am
Suggestion ko lang po, sana sa susunod po sana mas marami na pong example. tapos wala na po munang MASYADONG magtatanong HAHAHAHHAHA tongue

Sorry Jungkook Peacee!
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:22 am
justjoking10 wrote:
Louise Sebastiane Yagi wrote:Ma’am possible po ba sa if and sa else, parehong may loop?

Sent from Topic'it App

Pwede. If hinihingi ng problem mo.
Oo pre as long as structured yung program. wag ka munang mag spagetti code. Razz Razz
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:23 am
Sean wrote:may mga loop talaga na di natin alam na may mas maikli pa palang way .

Sent from Topic'it App
yah! yah! yah! Laughing Laughing Laughing Razz Razz
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:26 am
justjoking10 wrote:
Louise Sebastiane Yagi wrote:Ma’am possible po ba sa if and sa else, parehong may loop?

Sent from Topic'it App

Pwede. If hinihingi ng problem mo.

anyone please give an example
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:28 am
Lawrence wrote:
Pox wrote:Structure pa rin po ba kahit wala ng boolean expression sa program?

Sent from Topic'it App
pre pwede maging structured pag flowchart yung ginawa kaso walang patutunguhan. hahahaahha opinyon ko lang ehhe

para sa akin bawal. kasi kailangan ng boolean example Smile
avatar
ellariana
Guru
Posts : 10
Join date : 2018-08-16

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:29 am
mam examples pa po please farao
avatar
Rhei
Guru
Posts : 11
Join date : 2018-07-28

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Thu Aug 16, 2018 10:32 am
James Navarro wrote:Nakakakaba next lesson hahahaha

Sent from Topic'it App
oo nga ei, lalo na pag ipapakita na nila maam yung mga flowchart. tapos next meeting, quiz agad. SKL Crying or Very sad Crying or Very sad
Sponsored content

Comparing Selections and Loops Empty Re: Comparing Selections and Loops

Back to top
Permissions in this forum:
You cannot reply to topics in this forum