Questions tagged as 'loop'

1
answer

Code with indeterminate entries showing the pairs in ascending order and odd in descending order

I'm doing an exercise where the user places an undetermined number of numbers and they have to be presented by dividing the odd-numbered pairs, the pairs being incremented and the odd pairs decreasing. My question is how to take advantage of t...
asked by 22.09.2017 / 20:16
2
answers

End loop when an entry is empty

I have the following situation: A repeat loop that asks for a name, and 2 notes, where the data entry should finish when you read an empty name, but the way below the second time the program runs the name is not asked, any tips on how to do? n...
asked by 24.09.2017 / 17:58
3
answers

Save multiple records in the bank

I'm using the following code to no avail. $conn = mysqli_connect('localhost','user','pass','banco'); try { $body = file_get_contents("php://input"); $dados = json_decode($body); foreach($dados as $data...
asked by 09.10.2017 / 01:52
1
answer

How to open different web pages using the while

I would like the program to execute a command three times: wait 10 seconds to open a web page. For this to occur, set the following code: import time import webbrowser total_breaks = 3 break_count = 0 while(break_count < total_breaks):...
asked by 26.09.2017 / 21:11
2
answers

Javascript for Loop - Duplicate and incomplete content

I have a UL that contains some news, within it news is within li's . In this the first tag takes the Title of the news and the link of the matter. <ul> <li> <img src="" alt=""> <a href=""> T...
asked by 05.10.2017 / 22:31
1
answer

How to loop and get the value of the keys in an object

I would like to loop in an object in order to capture the value of the key and the corresponding value. For example: var obj = { 'Name' : 'String 1', 'Age' : 'String 2', 'Key N': 'String N' } I would like to return something like...
asked by 27.08.2017 / 21:49
1
answer

Variable not designated

Give me an error saying that the remainder variable was not assigned. There are several parts of the code that I do not understand and would like explanation.    Write a program that continually reads in integer values until a four di...
asked by 14.07.2017 / 15:17
1
answer

Doubt with operator

To solve this simple algorithm when I came across a silly question, there on line 4, does that even mean < or <= ? In the case for(k=4;k<7;k+=3) or (k=4;k<=7;k+=3) ? Thank you.     
asked by 03.06.2017 / 22:43
1
answer

Do While C ++ does not enter the loop using getline in string

Good afternoon people, I have a problem with my code. When I ask if the user wants to repeat the program, it simply does not loop. I have already tried using the user as numeric information and it worked, but I need it to be in the form of Strin...
asked by 02.05.2017 / 22:47
1
answer

In R: how to group the results of a loop in an rbind function?

Since I have a dataframe called page whose number of rows changes regularly, I wrote this code so that it fits the number of rows that my page$id has and I wrote this while so that it will generate a "g_com[numero]" fo...
asked by 09.05.2017 / 07:03