Posts by João Laurent • 81 points
9 posts
-
1
votes2
answers413
viewsQ: Reverse
package pag1; import java.util.Arrays; import java.util.Scanner; public class ex3 { public static void main (String[] args){ Scanner x = new Scanner (System.in); int posicao = 0; int[] numeros = new…
-
0
votes3
answers165
viewsA: Numbers smaller than the average
I found a solution: package pag1; import java.util.Arrays; import java.util.Scanner; public class ex2 { public static void main (String[] args){ Scanner x = new Scanner(System.in); double []…
-
1
votes3
answers165
viewsQ: Numbers smaller than the average
I need to average 20 numbers and present all the numbers below average. package pag1; import java.util.Arrays; import java.util.Scanner; public class ex2 { public static void main (String[] args){…
-
2
votes2
answers840
viewsQ: Numbers located in odd positions
I should present only the numbers present in the odd vector positions, but I’m stuck: package pag1; import java.util.Scanner; import java.util.Arrays; public class ex1 { public static void main…
-
2
votes6
answers7179
viewsQ: Simple Solution for Fibonacci Algorithm
I have this statement in hand: Given the Fibonacci sequence 1 1 2 3 5 8 13 ... n, write an algorithm to generate the sequence to the nth term, which must be provided by the user. For example, if the…
-
0
votes2
answers77
viewsA: Algorithm problem
resolution: public class ex10 { public static void main(String[] args){ Scanner x = new Scanner(System.in); System.out.println("Digite 3 valores em sequencia:"); int v1 = x.nextInt(); int v2 =…
-
0
votes2
answers77
viewsQ: Algorithm problem
Statement: Read 3 integers and order them in ascending order. At the end, show the values in ascending order, a blank line and then the values in sequence as read. public class ex10 { public static…
-
0
votes1
answer928
viewsQ: Write the average of the numbers typed, if they are even. Finish reading when user type zero(0)
Ex) Write an algorithm that averages the numbers typed by the user if they are even. Finish reading if the user type zero. I did so: public static void main(String[] args){ Scanner x = new Scanner…
-
1
votes1
answer41
viewsQ: Print the previous 30
I have to print the 30 numbers previous to the number chosen by the user. while(valor > (30 - valor)){ System.out.println(valor); --valor; } I did so, but he does not print the previous 30,…