Fill This Form To Receive Instant Help
Homework answers / question archive / Now that we have loops and decision making abilities, we can start creating some more advanced programs
Now that we have loops and decision making abilities, we can start creating some more advanced programs. While focusing on loops, but being able to use anything we've learned so far:
Now that we have loops and decision making abilities, we can start creating some more advanced programs. While focusing on loops, but being able to use anything we've learned so far:
DISCUSSION POST:
In real life, we can see loops and encounter them. In the age of social media and the internet, I thought of the perfect example for loops. Let's say that your family member signs up for Facebook. Upon accessing the site for the signup option, they are asked to input their age. This is because users who are aged 13 and below are not allowed to use the application. If the user is less than 13, the signup page will terminate their application by flashing a sign saying, "Sorry, you're too young." Another example of a loop would be the view friends list option of the site which shows the profile picture, name, and profile link. One can use the following loop to solve the problem:
foreach(var $friend in $user->friends) {
show_friend($friend);
}
In this way, the friends displayed in the profile would be different from each other and not recurring.
Of course, before actually making use of loops, one must first identify the problem and identify the possible solutions to the project. After that, the programmer will be able to use a loop to solve a particular problem.
After doing this, I realized that I still have a lot to learn in programming.