Explain when you would use a "while" loop rather than a "for" loop and vice versa. Provide an example of one such instance. How are looping statements different from selection statements?
HiCustomerWhich programming language are you using or you just need psudocode examples..
I am using JDK 6 upgrade 13 but I need psudocode examples.
Can you also help me with this question?
I did the step by step instruction of toasting bread but he wants the refinement steps.
This my answer:
Algorithm for making toast
1. Get bread from bread pan.
2. Get butter or jelly out of refrigerator 3. Get plate out of cupboard 4. Get butter knife out of drawer 5. Plug toaster in 6. Insert bread into toaster 7. Turn toaster on 8. After toasting is completed, remove bread from toaster and place on plate 9. With butter knife, spread butter or jelly on toast Algorithms is a formula or set of steps for solving a particular problem. Algorithms provide an organized structure to our daily lives. Algorithms can easily be followed when completing any task. If you are putting something together, if the steps are completed in algorithm, it can easily be identified and corrected, you can continue from there. This helps to organize daily task or work related projects as well as provides you with problem solving tools if an issue arise.
He is looking for sequence of refinements -- the first being the broad outline.For example, when writing code we might start withpublic class X {static void main(String args[]){}}this class/program will compile and execute.my next refinement might add:public class X {public void doInitialize(){// 1. initialize variablesdoInitialize();}static void main(String args[]){
HiThats too much of work.I will opt out and see if anybody else can help.
I can help you with this........1. you need to know when can "while" be used best rather than "for" and same in reverse right??2. difference between looping statement and is it conditional statement??
If you need answer to this then please specify Yes in your post........Just after thisRaj39956.9072827894