Skip to content
Advertisement

Tag: loops

Printing multiple user input from a loop

This is a two part question. 1) how do I print all userinput if the loop runs more than once , I am aware the old string assigned to the variable gets erased each time. 2) how do i calculate the total task duration across all tasks for the amount of times the loop runs. thanks. Answer You can create

Do a task with interval in a loop

I already saw many question here but nothing worked for me. I wanted to set the text in a text view after every 1 second. This is what I tried: This does the task immediately and only the last number is seen. Then this: in this the screen shows blank white and after 90 seconds, I see the last number.

Java Calculator program issue

I am trying to develop a calculator program that inputs an arithmetic expression of the form number operator number = and computes the result of the expression. The expression will be evaluated from left to right not considering regular operator precedence. For example, the expression 14 – 5 * 3 = will produce 27.0. The value = displays the final

How to fully print outer loop before inner loop (Java)

My goal is to print a chart that displays “enemy” number, x and y coordinates, then their distance in respect to the other “enemies”, but with my following nested loop below, the enemy number, and coordinates are reversed with the distance numbers. I’ve tried adjusting the position of the codes, but they don’t seem to fix the issue. Answer

Advertisement