Skip to content

Instantly share code, notes, and snippets.

View jpolivra's full-sized avatar
building new stuff

João P. Oliveira jpolivra

building new stuff
  • Syngenta Digital
  • Brazil
View GitHub Profile
@jpolivra
jpolivra / adt_exc8.cs
Created October 20, 2023 21:43
Vector class with default/custom initializer length. Vector methods: Generate - Populate the vector; List - List vector values; Insert - Update vector position with provided value; ExtractValue - Extract specific position value; ExtractEdges - Extract lower and higher number value present into vector.
using System;
namespace abstract_data_types;
class Program
{
class Vector {
private int[] _V;
private Random random = new Random();
@jpolivra
jpolivra / adt_exc7.cs
Created October 20, 2023 21:08
Make a program that read two complex numbers and perform math basics operations around them (sum, subtract, multiply and divide).
using System;
namespace abstract_data_types;
class Program
{
class Complex {
private double _PReal;
private double _PImag;
@jpolivra
jpolivra / adt_exc6.cs
Created October 19, 2023 23:43
Make a class of a vehicle, the class must receive the name, brand, year and plate. The class should have a method responsable by showing the car information.
using System;
namespace abstract_data_types;
class Program
{
class Vehicle {
private string _Name;
public string Name
@jpolivra
jpolivra / adt_exc5.cs
Created October 19, 2023 20:58
Receive patients with the following properties: Doctor name and Appoitment data. Then provide a way so the user can be able to search for a specific doctor patients data.
using System;
namespace abstract_data_types;
class Program
{
class AppointmentDate
{
public int Day;
@jpolivra
jpolivra / adt_exc4.cs
Created October 19, 2023 01:02
Receive product information. Log the products with the prive above the one inputed by the user.
namespace abstract_data_types;
class Program
{
struct ExpirationDate
{
public string Month;
public string Year;
}
@jpolivra
jpolivra / adt_exc3.cs
Created October 18, 2023 22:28
Build a table that contains employee name and phone number. Provide a way so it should to possible to search for the employee.
namespace abstract_data_types;
class Program
{
static void Main(string[] args)
{
string[,] EmployeesTable = new string[5, 2];
int i = 0;
@jpolivra
jpolivra / adt_exc2.cs
Last active October 18, 2023 22:29
Given 5 students, get them grades taking in care that 3 tests were applied. Then calculate the classroom arithmetic mean and each student total grade.
namespace abstract_data_types;
class Program
{
static void Main(string[] args)
{
double[,] StudentsGrades = new double[5, 3];
for(int i = 0; i < 5; i++)
@jpolivra
jpolivra / adt_matrices.cs
Created October 17, 2023 00:28
Abstract data types: matrices.
using System;
public class AbstractDataTypes
{
public static void Main(string[] args)
{
// Matrix example
// 5 8 3 2 9
// 9 0 1 4 2
@jpolivra
jpolivra / adt_vectors.cs
Created October 16, 2023 22:01
Abstract data types: vectors.
using System;
public class AbstractDataTypes
{
public static void Main(string[] args)
{
int[] Vector = new int[5];
for(int i = 0; i < 5; i++)
{
@jpolivra
jpolivra / facape_algorithms.py
Last active March 14, 2023 22:50
Exercício em Python - Algoritmos - 17/02
# Aula - 17/02
# Crie 4 variáveis que receba com a função input a nota de um aluno e calcule a média aritmética das
# notas, depois imprima o valor dessa média na tela.
# Declaração das variáveis
nota1 = 9.0
nota2 = 8.0
nota3 = 8.0
nota4 = 5.0