Posts by Magno • 309 points
7 posts
-
2
votes2
answers120
viewsQ: How to declare a vector with 2 positions?
I have an exercise with the following statement: Write a class whose objects represent students enrolled in a class. Each object in that class must keep the following student data: registration,…
-
5
votes1
answer142
viewsQ: Why do local variables not receive default values from the Java compiler or JVM?
Why the compiler assigns values default for attributes but not for local variables? public class Teste{ int a; public void metodo() { int b; System.out.println(a); System.out.println(b); } }…
-
7
votes1
answer309
viewsQ: Java how to compare "float" to "null"?
public class NuloOuNao { public static boolean isZero(float num) { if(num == null) { return true; }else { return false; } } public static void main(String[] args) { isZero(10); } } Row 5: The…
-
-4
votes1
answer226
viewsQ: Java methods?
I’m developing this simple scheduling algorithm but the methods listar() and buscar() are not working, I choose and is simply ignored. package strings; import java.util.Scanner; public class Agenda…
-
1
votes1
answer93
viewsQ: Language C, matrix exercise
#include <stdio.h> #include <stdlib.h> int main() { int matriz[5][5]; int i, j, posicao=0; int maior = matriz[0][0]; int menor = matriz[0][0]; int posicaoI=0, posicaoJ=0, posicaoi=0,…
-
-2
votes1
answer64
viewsQ: Miscalculation
#include <stdio.h> #include <stdlib.h> float dobro_do_maior(float x, float y) { float dobro; if(x > y) { dobro = x * 2; }else{ dobro = y * 2; } return dobro; } void main() { float a,…
-
4
votes1
answer5022
viewsQ: Mysql command alter table, difference from "Modify" and "change"?
What are the main differences in change and Modify, in which cases should I use them ? alter table cadastro change nome nome varchar(20); alter table cadastro modify nome varchar(30);…