Lesson 10. As we see in the previous lesson, now we’ll make some algorithms to practice. Those are 10 questions. I recommend that you make this algorithms because it’ll help you in the future. 1- Make an algorithm that reserves how tall is a person and test this conditions: If the Tall is greater than 1.90, printf (“You can play basketball”); If the Tall is smaller than 1.50, printf (“You’re not taller”); if the Tall is greater or equal to 1.50 and smaller or equal than 1.90, printf (“You’re between arrive”); 2- Make an algorithm that works as a game, it may ask to user “What’s the Spanish Capital?” so the user will have available 4 possibility, they’re respectively a) Madrid, b) Barcelona, c) Vigo, d) Sevilla, after will be tested them. Note: use for store the result, a character type variable. If the variable is equal to ‘a’, so printf (“You’re Wright”); Else, so printf (“You’re wrong”); 3- Make an algorithm that works as a table,...
As promised in the last class, I present to you the Loop Do While. First, what’s a Loop? A loop is by definition a command that repeat a action inside code considering some situations. Access the Lesson 2 to more information. Below, see the structure of Do While Command: In others words, we have ‘do’ or make this code, only in the end, it’ll tested, then can happen that the condition be false, but the code will be ran once. Now, see a example with Do While being ran. Below, see the code allow being ran. First the Do While command RUN, after it TEST, remember always! In the next lesson, I will do 5 challenges to you practice. Well, that’s all Folks! See you later!
Now, I present to you the While command. It’s similar to Do While command in the lesson 14. below, we can see the structure. Below, see a example about the While loop use and the print of it running . Write it in your compiler. But if the condition be false, the code inside while will not ran. See the next example and test in your compiler. Well, it’s the enough to use the While loop. Please make the Challenges 14.1 using the Loop While learned in this lesson. In the next lesson, we’ll see the Loop FOR. Well, that’s all folks See you later!
Comentários
Postar um comentário