Posts by Paulo Eduardo • 55 points
4 posts
-
1
votes2
answers220
viewsQ: How to pass an attribute of the child class through the constructor to the mother class
I have 3 classes Mother class: Animal Child Classes: Dog and Cat I want to save the name attribute only when one of the objects is instantiated Gato or Cachorro. In the mother class I have the…
-
3
votes2
answers74
viewsQ: How do I stop "for" when I find an item in the list?
I have the following code: Console.Clear(); Console.Write("Nome da moto:"); string nomem = Console.ReadLine(); for (int i = 0; i < ListadeVeiculos.Count; i++) { if (nomem ==…
-
-3
votes1
answer104
viewsQ: Builder without parameters is not working, is leaving the object as null
I have a class with two constructors. The empty constructor (no arguments) is not working. Script shows no error. One of the constructors receives the parameters nome and limitedecredito; and…
-
1
votes0
answers51
viewsQ: My function is not checking the IF condition is already going straight into the ELSE
private int dia; private int mes; private int ano; public bool GravaData(int d, int m, int a) { if ((d > 0 && d <= 31) && (m > 0 && m <= 12) && (ano >…