Posts by Luis Gomes • 7 points
5 posts
-
-2
votes1
answer339
viewsQ: The difference between the value of a maximum and minimum element of a vector recursively
I made that code : int difrecursivo(int *vetor,int tam){ if(tam == 1) return vetor[0]; else{ int max = vetor[0]; if(max < vetor[tam-1]) max = vetor[tam-1]; int min = vetor[0]; if(min >…
-
-2
votes1
answer215
viewsQ: How to implement the strcpy function without using the c++ <string> library?
I was unable to develop an effective code, since I do not understand the language as I should. It doesn’t leave that part : char *strcopy(char *destination, char *origin)
c++asked Luis Gomes 7 -
0
votes1
answer44
viewsQ: How to add objects to a repository class? And how can the user choose the amount of array in which he will add the data?
Hey, here’s my question. I would like to know how to read the user data in main as follows: I have an array of up to 10 for the user to put the book data, but he can choose less. And another, after…
javaasked Luis Gomes 7 -
-1
votes1
answer49
viewsQ: Error:java.lang.Nullpointerexception at user.Mein.main(Mein.java:15)
Can someone enlighten me a little, is giving error in the line where I start to fill the user array. public Usuario(String nome, String sobrenome, String cargo,int idade,double salario) { this.nome…
javaasked Luis Gomes 7 -
-1
votes2
answers1338
viewsQ: How to generate sequential ID?
I’m trying to generate a sequential ID for each user registered on the system, but all users leave with the same ID number generated. public class User { // ... int id=1; public void gerarid() {…
javaasked Luis Gomes 7