Questions tagged [do-loops]

a 'do' loop is a specific type of iteration used to run code repeatedly based on the evaluation of a boolean statement or variable.

do (while) loops in Java: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html

do loops in Fortran: https://en.wikibooks.org/wiki/Fortran/Fortran_control#Loops

do loops in Scheme: https://schemers.org/Documents/Standards/R5RS/HTML/

389 questions
0
votes
2 answers

Having a hard time to understand loops

Yeah...that is easy to understand loops. I know what each loop does. But the problem with me is that each new problem creates new troubles for me. I get stucked and if somehow I can solve one, there is always a better solution on web and that…
user5117637
0
votes
1 answer

Insert Template with Loop x Amount of Times

I'm back with another question that probably has a simple answer. I really fall down when it comes to loops, so this is what I am trying to build. I am building a form where user will type in a number between 1 and 156 (named range "GenNo") and…
JaayB
  • 138
  • 2
  • 14
0
votes
0 answers

Do Until Loop with Group by in SAS

I'm trying to run a do until loop in SAS for a set of stores with different SKU's and DCs to find a TSF_Qty for each SKU/DC combination. I am trying to sum up the SKU/DC's TSF_QTY as SUM_TSF_QTY and change the increment_percent until the…
WCannon
  • 1
  • 2
0
votes
2 answers

Combination of If Then and Do Loop (I think)

This is probably an easy question for someone who is familiar with VBA, but as a newbie, I am totally coming up empty. I've got two sheets, one is the raw data that I am already using code to pull from Project with no issues. The other is the…
sfowler38
  • 5
  • 6
0
votes
1 answer

"do for" and "do if" in java pseudocode

for an assignment I was given java pseudocode that included lines: do for i = 0...j-1 do if i = 0 and j = 1 for k = 0....i-1 do q <- l[k,i] + dist(p[k],p[j]) since the only use for "do" in java that I am aware of in java is do-while loops,…
jokeSlayer94
  • 143
  • 1
  • 9
0
votes
2 answers

FORTRAN counter loop returns multiple iterations of the same value

First of all I am a complete novice to FORTRAN. With that said I am attempting to "build" a box, then randomly generate x, y, z coordinates for 100 atoms. From there, the goal is to calculate the distance between each atom, which becomes the value…
0
votes
1 answer

Provoke an interruption in a main logic loop

I am making this puzzle game which receives a letter from the keyboard with Scanner(System.in) and it changes the puzzle state. Now, I am making a GUI for the game. I have a JPanel with JLabels which shows the puzzle and another JLabel with 2…
0
votes
1 answer

How to find the square root using the Newton-Raphson Method in fortran 90

I need to write a program to find the square root using the Newton-Raphson Method using a guess estimate. the equation for the Newton-Raphson Method is: xn+1 = xn-xn**2 − a/2*xn whereby n is the number of iterations. The assignment tells me that a…
0
votes
2 answers

Do Until count using Inputbox never terminates

I am trying to get a Do Until loop to work in VBS. I ask the user for a number and then I want the script to Do Until the count is equal to the number the user entered. number = InputBox("number") count = 1 Do Until count = number Wscript.Echo…
Jono
  • 17
  • 5
0
votes
2 answers

error in my vector array in fortran 90

*i made an earlier post to do with my assignment and i managed to get much appreciated help, however i am stuck once again. i am in no way trying to get my homework done or anything like that i just dont understand it. the assignment tells me to…
0
votes
1 answer

How to make selection move through variable data in VBA

I am trying to continue the process until the end of the cells, but the selection needs to change in a set order. Here's the code: ' C_P Macro ' copies from worksheet & pastes in new sheet ' Keyboard Shortcut: Ctrl+Shift+L Dim rng1 As Range Dim…
Ivan W
  • 3
  • 4
0
votes
1 answer

Getting unique values from loop in rails

I've got it so that I have a list of the unique patients a clinician is having a conversation with. I can call up details about the patients but I can't call up anything to do with the associated comment. app\views\comments\index.html.erb <%…
Skiapex
  • 153
  • 3
  • 14
0
votes
2 answers

How do I create a runner for this program? (To test it)

I am writing a program that counts the amount of vowels in a string and if there are more vowels than consonants, it returns true. If not, false. This is a homework assignment, but the runner is not part of it. I want to test to see if my program…
Nicole I.
  • 87
  • 1
  • 3
  • 10
0
votes
2 answers

Java Assign value to incrementing array

My problem is that I am unable to assign a value from a .txt with a list of words, to an array. I believe the issue is that I am asking for something that is not yet available, like asking for something from the future without knowing it. This is my…
NoviceCoder
  • 9
  • 1
  • 1
  • 4
0
votes
2 answers

Fortran: Counter inside DO-loop

I have an array, from which I want to have some information. I wrote a small DO-loop, but I don't know why it always returns integer :: inn=0 parameter :: m=115200 real*8 :: da1(m) DO i=1, 115200 IF( i<=19200 .and. da1(i)>1 .and.…
PT2009
  • 117
  • 1
  • 10