Questions tagged as 'while'

0
answers

Problem with while (! cursorIsAfterLast ())

I have this method public ArrayList<Estadisticas> getStats(int p_id) { String[] columnas = new String[]{"_id", "user_id", "letra", "jugadas", "errores", "acertada", "tiempo"}; Cursor cursor = this.getReadableDatabase().query("est...
asked by 28.06.2018 / 17:48
0
answers

Paint table with data stored in the database

When you paint the table and fill it, it shows the data of the last line that was saved, but in the database if the correct values of the previous values are saved but in the load it only shows the last one. $sql = mysqli_query($con, "se...
asked by 18.06.2018 / 18:10
1
answer

how can I create a grid from a while loop

I need to create a grid of 8 elements with the name of the items, the quantity and the price with random numbers, I have done this, but I do not know how to use the while loop to form the grid. <table> <tr><td>Nombre</td&g...
asked by 15.04.2018 / 23:50
1
answer

How would you then declare a loop with while, remove elements from it?

How could in this case draw the ages that are less than 18, those that are greater than 18 and then print them? I did it that way but the loop works but not the print. Edad_persona=int(input("Ingrese su edad:")) while Edad_persona!=999: pr...
asked by 07.04.2018 / 19:46
1
answer

Help! How do I get out of a while loop when it stays cycled in another while loop?

I have a cycle while to read a file .csv and another cycle while to read a array of letters. Inside I should print a letter and a line of .csv. But it remains cycled and only prints each letter of the alp...
asked by 23.02.2018 / 21:19
1
answer

How to make a random button that a number is 'a prize' and another 'an earthquake' without both values ever matching

Hi, I'm good at this, I do not fall into how to make a button of a prize, another a disaster (earthquake), and it would be from 1 to 5 randomly, it is for a game, both can not be repeated, Let randomly the two buttons never give the same value....
asked by 21.01.2018 / 19:10
1
answer

Loop to perform updates on several DBs at the same time?

I'm looking for a way to make the same change to different databases that start and end with the same syntax, just change the base number. I have the following code but it does not work for me, just update the first Base DECLARE @numero_alu...
asked by 13.12.2017 / 13:46
1
answer

Compare the rows of a table shown with a while

I am writing a code that shows the data of a table stored in a BD using a While cycle. The table shows 4 data that are ID , id_cliente , Mes de pago , monto . On a client the While shows me 3 records ID id_clie...
asked by 06.12.2017 / 22:48
2
answers

Problem with do while loop in JAVA [duplicated]

I have the following dive while: ArrayList<String> nombreP = new ArrayList(); ArrayList cantidadP = new ArrayList(); do{ System.out.println("Producto?: "); nombreP.add(i, sc.nextLine()); if(nombreP.get(i).equal...
asked by 16.12.2017 / 00:00
1
answer

I do not know what I'm failing with this Do While

Greetings people. I'm starting with Java and doing an exercise testing the do_while I do not know at what point I'm failing. The intention of the loop is that if the user enters a value lower than 1 or higher than 4, the program will ask the use...
asked by 29.11.2017 / 21:25