Share
Go down
avatar
Admin
Posts : 42
Join date : 2018-07-24
Age : 20
Location : Dasmarinas City of Cavite
View user profilehttp://daniella.forumotion.asia

Comparing Selections and Loops

on 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.



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.

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.


Efficient and structured logic for getting and displaying employee records
avatar
Guru
Posts : 12
Join date : 2018-07-31
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 15
Join date : 2018-07-27
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 11
Join date : 2018-08-01
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 25
Join date : 2018-08-01
View user profile

Re: Comparing Selections and Loops

on 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.
avatar
Admin
Posts : 42
Join date : 2018-07-24
Age : 20
Location : Dasmarinas City of Cavite
View user profilehttp://daniella.forumotion.asia

Re: Comparing Selections and Loops

on 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
avatar
Admin
Posts : 42
Join date : 2018-07-24
Age : 20
Location : Dasmarinas City of Cavite
View user profilehttp://daniella.forumotion.asia

Re: Comparing Selections and Loops

on 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)
avatar
Admin
Posts : 42
Join date : 2018-07-24
Age : 20
Location : Dasmarinas City of Cavite
View user profilehttp://daniella.forumotion.asia

Re: Comparing Selections and Loops

on 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
Guru
Posts : 19
Join date : 2018-07-27
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 25
Join date : 2018-08-01
View user profile

Re: Comparing Selections and Loops

on 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.
Guru
Posts : 10
Join date : 2018-08-01
View user profile

Re: Comparing Selections and Loops

on 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.
Guru
Posts : 10
Join date : 2018-08-01
View user profile

Re: Comparing Selections and Loops

on 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
avatar
Guru
Posts : 12
Join date : 2018-07-31
View user profile

Re: Comparing Selections and Loops

on 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
avatar
Guru
Posts : 12
Join date : 2018-07-31
View user profile

Re: Comparing Selections and Loops

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

Sent from Topic'it App
avatar
Guru
Posts : 12
Join date : 2018-07-31
View user profile

Re: Comparing Selections and Loops

on 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://illiweb.com/fa/i/smiles/icon_lol.gif[/smiley] Careful , dapat observe talaga ang Loop Control Variable [smiley]https://illiweb.com/fa/i/smiles/icon_smile.gif[/smiley])

Both yan maam hahahaha galing nyo po magturo Smile

Sent from Topic'it App
avatar
Guru
Posts : 11
Join date : 2018-08-11
View user profile

Re: Comparing Selections and Loops

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

Sent from Topic'it App
avatar
Guru
Posts : 11
Join date : 2018-08-11
View user profile

Re: Comparing Selections and Loops

on 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.
avatar
Guru
Posts : 11
Join date : 2018-08-11
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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!
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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
Guru
Posts : 10
Join date : 2018-08-16
View user profile

Re: Comparing Selections and Loops

on Thu Aug 16, 2018 10:29 am
mam examples pa po please farao
Guru
Posts : 11
Join date : 2018-07-28
View user profile

Re: Comparing Selections and Loops

on 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

Re: Comparing Selections and Loops

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