Posts by Vitor Gonçalves • 552 points
31 posts
-
0
votes0
answers18
viewsQ: Does the true value of a number change when I change its float type.?
Change my data set to float32 or float16, is changing the "true" value of my data? If I have the value 3.6, using python and reading in float64 he remains 3.6, but it changes when I put in float32,…
-
-1
votes1
answer77
viewsQ: Error saving an image obtained by Opencv
Directory where I need to save Banco-de-Faces\nome Directory where he is saving: Banco-de-Faces My code: cv2.imwrite("Banco-de-Faces\\" + nome + str(framesObtidos) + ".png", imagemRosto) My program…
-
-3
votes1
answer123
viewsQ: Implementation of the Java Mysql MVC model
In my model I am accessing Clientedo by the controller of my model Customer as seen in the example below. I would like to know if this practice is correct for the mvc model, since both classes…
-
0
votes1
answer88
viewsQ: capture duplicity error in mysql with java
I’m trying to show a message that there is already a registered id, but it falls in the catch that shows: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry…
-
1
votes3
answers72
viewsQ: mysql repeated names by select
I am trying to show a table where only the name of the author appears once in which his book is in stock=0, however I am getting the name of all authors in duplicate, even when the author has no…
-
3
votes1
answer134
viewsQ: Variables and methods in the abstract class, where to put?
Cliente and Fornecedor has name, phone and email in common what is the best way for me to treat this, should I create these variables in common in the abstract class? or is there a better way for me…
-
2
votes1
answer77
viewsQ: Set Variables by Java Constructor
It is certain to "set" the variables passing by parameter directly in the constructor, equal to this code? public class Retangulo extends FiguraGeometrica{ private double largura; private double…
-
0
votes2
answers50
viewsQ: "List" remains null after using Python append
I would like to understand why t2 is null after assignment of t1+append. t1=[1,2] t2=t1.append(3) print(t2)
pythonasked Vitor Gonçalves 552 -
2
votes2
answers113
viewsQ: isinstance() does not produce the expected result after a data entry
I made the following example of factorial using function isinstance(). def factory(n): if not isinstance(n,int) or n<0: print('NAO E NUMERO INTEIRO VALIDO:\n') return None if n==0: return 1 else:…
-
-2
votes1
answer49
viewsQ: abstract class error (invalid new-Expression of Abstract) C++
Well I’m with an error in my 3 daughter classes(dvd,games,car) of a mother class calls video rental. I am trying to use the Factory method and generates the error in the new with the following…
-
0
votes1
answer108
viewsQ: how to pass char from the main int to a class c++?
I’m struggling with how to pass a char type variable from the int main and play to a variable in the class. Example of the way I’m trying: class Nome{ private: char n[50]; public: void set_nome();…
-
0
votes1
answer1682
viewsQ: Check if a letter exists in the c++ string
I’m having problems in my function that checks the existence of a specific letter in a string (I don’t know much about pointers I only used because my other function wasn’t returning the string if…
-
2
votes1
answer245
viewsQ: What is the purpose of using pointers and allocation in c/c++
I would like to understand what pointers are in a generic way and their use, I see simpler codes as registration that I myself do in codeblocks run smoothly without them. Similarly I’m doubtful…
-
0
votes1
answer282
viewsQ: error creating matrix with variables in c++
When I declare matrices in c++ within a class, defining "rows' and "columns" of that matrix by integer numbers directly with arguments, example [2][5] I can have the correct functioning. However…
-
2
votes3
answers80
viewsQ: Do I need to re-allocate a structure in case I clean up just a part of it?
I have a struct who owns nome and horário for appointments. typedef Struct{ char nome[20]; char data[20]; }Dados; I make the statement: Dados *dados_cliente[quantidade]; I make the allocation…
-
8
votes1
answer280
viewsQ: "#define" defines a global variable?
I’ve always used a few definebut now this doubt has arisen, when I use a #define am I creating a global variable? Is there any harm in this use? Example: make program to read 10 numbers: I put in…
casked Vitor Gonçalves 552 -
1
votes1
answer75
viewsA: How to make a string to be "transformed into a number"
Hi, trying to solve your problem I’ll list some string conversion functions that may be useful but remember to include the library: strings. h double atof (const char *string); //Converte uma string…
-
0
votes2
answers221
viewsA: Vector ordering problem in C
Are you trying to sort using the correct bubble method? , so would the program (in ascending order): but rather the summary on ordering: Example: a=10 b=5 , I can’t change their values to simply…
-
2
votes1
answer84
viewsQ: How to assign character array in a structure?
The program reads 10 films, each film has gender name, and age rating, then lists; I’m having trouble assigning matrix string (I think it’s just that mistake) #include <stdlib.h> #include…
-
1
votes1
answer63
viewsQ: String marking and value return
Here is my program, I need to register up to 100 products, each product is available in 5 stores and I need to say the quantity sold of each product in each of the 5 stores. I will have a menu that…
-
-1
votes1
answer1955
viewsQ: How do I ask the user to type the vector size?
I’m just using vectors with a defined number using the define or even direct on the variable. How I put the amount of vectors the user chooses?. example: #define NUMERO x int main() { int…
casked Vitor Gonçalves 552 -
5
votes1
answer105
viewsQ: Average is not calculated
I need to write a code that reads only 20 integer values, at the end add the positive numbers and average the negative numbers. It normally adds up the positives but when it arrives at the time of…
-
0
votes1
answer675
viewsQ: Multiply n numbers in c
What reason does my code, regardless of the numbers typed multiply with the number I put in order for the loop to be false? I just wanted to multiply the values I typed and not multiply the number…
casked Vitor Gonçalves 552 -
4
votes2
answers1292
viewsQ: What’s best to use, scanf() or get_s()?
Taking the name 'Maria da silva' as an example: scanf() just go read Maria, get_s() will read it all, correct? I’m in doubt of the best use, my college professor says we should clean the buffer to…
-
2
votes3
answers2944
viewsQ: While use within the if
I have to read infinite averages of students and if they are greater than or equal to 7 the student is approved , if not, he is flunked , and if I type -1 the program to and sends a message of…
-
-1
votes1
answer560
viewsQ: how to check a string in if
I have the code: Why it is not giving positive for the if? { char placa[9] = "G" "A" "E" "-" "0" "2" "4" "4"; char cor[15] = "branco"; int ano = 2001; printf("A placa: %s\n", placa); printf("A cor:…
casked Vitor Gonçalves 552 -
-4
votes2
answers451
viewsQ: How to give 'value' to a char variable?
I have a question about how I can give value to the char variable without the scanf command, for example: I have a variable called name and I want to say that it is worth maria. how do I do that?…
-
0
votes2
answers183
viewsQ: Value Assignment Doubt in c
Here’s my code, why is there a change in the other variables, I’m not just changing the line line to variable value? why the others change? int a = 1, b = 2, c = 3, valor = 0; valor = a;…
-
-1
votes1
answer41
viewsQ: Increment and Decrease Operators
Why didn’t it add up the value of variable 1 , plus 1 in the first printf. int numero = 1; printf("Conteudo armazenado na variavel: %d\n", numero++); /*(por que aqui da resultado 1? não estou…
casked Vitor Gonçalves 552 -
1
votes1
answer43
viewsQ: How I define a unit of measure in the value of the variable
I have a question asking that I calculate the volume value of an oil can, and thinking about it I will use float. How do I place a unit of measure, for example the variable altura = 50cm.…
-
-1
votes2
answers701
viewsQ: How do I use %d or %c... in Cout instruction?
I am studying C and C++ and would like to understand how I could transform this code written with printf() in cout, or how to use the functions %d %x %c, etc. in the cout. int main() { printf("i…