Access over 35 million academic & study documents

Java loops

Content type
User Generated
Showing Page:
1/16

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/16

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/16

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 16 pages?
Access Now
Unformatted Attachment Preview
By Nancy 2015 | By Nancy | CONFIDENTIAL Objective-Day3(1 hour) While loop  Do While loop  Sentinel value  For loop  2015 | By Nancy | CONFIDENTIAL The need of loops  Suppose you have requirement saying “receive input from end user. The input value should be less than 100.Keep asking until received the right value.” 2015 | By Nancy | CONFIDENTIAL How we goanna do it>  Study the example and try answer which one is correct implementation of the problem statement mentioned on last slide. 2015 | By Nancy | CONFIDENTIAL The blue code section?  It will work, yes. 2015 | By Nancy | CONFIDENTIAL The black code section?  Yes , It will work too. 2015 | By Nancy | CONFIDENTIAL Do While loop   Lets solve the problem with do while loop. Do while loop ensures the execution of the loop at least once. 2015 | By Nancy | CONFIDENTIAL Do While Loop continue…  At least one time the control goes into loop and than checks for the condition need to be implemented. 2015 | By Nancy | CONFIDENTIAL Output  The do while program runs like this… 2015 | By Nancy | CONFIDENTIAL Sentinel Value?    Suppose I wanted to read many values and being a end user I can input as many time as I want. Being a good programmer , I don’t want to restrict my end user to N number of input instead I allow him/her to input and exit the system when he/she wants. Sentinel value helps us achieving this task. 2015 | By Nancy | CONFIDENTIAL ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4