Questions tagged as 'loops'

1
answer

List the number of records in Java

How can I list the number of records that appear in a program? It is assumed that the user enters the number of records you want, once this is done, the data is output but they need to be listed. import java.util.*; public class practica1Labor...
asked by 13.01.2017 / 07:44
1
answer

Show the letters of a string and how many there are

I have a code that shows me the letters of a name and the number of letters in that name. But when he prints the letters and how many there are, he repeats the letters he has already read and tells me the spaces. Here the code: create or REPLA...
asked by 26.02.2017 / 03:15
1
answer

Replace characters of a string in python using Lists

Good! I try to make my script go through a string and replace each character with another string using lists to be able to change each of the characters in a simpler way, but when going through my list it does not replace them beca...
asked by 27.11.2017 / 02:22
1
answer

Use input () within a for cycle (Python)

I am trying to create a matrix in which the user enters the number of rows, columns and each term: colum=int(input('Cantidad de columnas: ')) fil=int(input('Cantidad de filas: ')) matriz=[[str(input('[',i,',',j,']-esimo termino: ')) for i in r...
asked by 30.03.2017 / 16:15
1
answer

Update value within a for batch

I want to update a value of a variable in a program in batch , my problem is that when I do it inside the main function , the value is not updated, if I pass that value to < em> another function the value is updated but when I return it...
asked by 04.01.2017 / 17:42
1
answer

how to get the item from a list in java and pass it to a variable?

I have the following code, which sends a query that returns a list, within that list there is an element called getHoraEntrada, which comes in Date format, and I in my view just want to show the time, so what I did was create a variable String...
asked by 22.02.2018 / 00:19
2
answers

Problems in while with if to accumulate

I have a problem I want to do an accumulation of parts and payments within a while and then accumulate based on the employee and then paint the data on screen. But you skip the information related to the name by a column. 2939 DEL...
asked by 26.10.2016 / 20:10
2
answers

Create a for to consult values of a data

I have a data with several variables and I want to use a for to scroll through several variables and check the values. The data table data contains the variables V1, V2 ... V15. What I want is to create a Stotal variable that is the sum of th...
asked by 07.12.2017 / 13:15
1
answer

subset data in a loop for R

I'm doing a script in R where a for loop iterates over a vector string called iter. The following code works and generates a variable named as the value that iter takes at that moment (i) that contains the filtering of a dataframe according to i...
asked by 10.02.2017 / 09:55
2
answers

Counter unexpectedly increases within a loop

I'm trying to do a small program in C ++ that asks the user for a range of values (xmin, xmax) , (ymin, ymax) . The aleatoriamente program will choose two values between (xmin, xmax) y (ymin, ymax) respectively and multipl...
asked by 09.12.2016 / 17:41