Questions tagged as 'array'

2
answers

Go through php array variable

I have a $ array variable that contains array values that were received from a JSON.stringify(venc) [ {"Nº da Parc":"1","Data do pagamento":"06/04/2017","valor a pagar":"R$ 50,00"}, {"Nº da Parc":"2","Data do pagamento":"06/05/2017","va...
asked by 07.03.2017 / 03:27
2
answers

How to delete an element from an Array String?

I'm having the following compile error: del(alimentos[i]) TypeError: 'str' object doesn't support item deletion What did I do wrong? I would like to remove the typed element from the list. My code: dieta = [] alimentos = "" comer =...
asked by 12.05.2017 / 22:23
1
answer

How do I not print repeated numbers?

How do I not print repeated numbers? I saw some examples on the internet but they were something very complex in which I did not understand anything: x #include <stdio.h> int main (){ int vetA[10], vetB[10], vetC[20], i, j; printf ("In...
asked by 22.10.2017 / 23:48
4
answers

Organize positions of a vector

I have an exercise that asks you to create two vectors, with real numbers and with 3 elements each. Then copy these values to a new vector with 6 elements. However, the first 3 values must be of the vector that has the highest summation value am...
asked by 18.02.2017 / 16:25
1
answer

How to sum the values in a loop?

I want to add and display the total value of the query. In the case of 3 patients the sum would be 1350. But something is going wrong. case 2 : printf ("Particular:\n"); printf("O valor da consulta e de R$ 450,00: \n"); for(i=0;i<3;i++) {...
asked by 26.05.2017 / 16:34
1
answer

Comparison of Array () PHP

I have the following arrays: $arrTag = "Array ( [0] => stdClass Object ( [id] => 1 [id_pacote] => 7 [id_fornecedor] => [nome] => Salgados - 100 Un [valor_compra] => 100 [valor_venda] => 150 [descricao] => Pacote de Salg...
asked by 03.11.2016 / 18:58
2
answers

Transform array of objects into just one array

I have a array with multiple objects : array(3) { [0]=> object(stdClass)#5750 (2) { ["value"]=> string(16) "[email protected]" ["key"]=> string(18) "email_client" } [1]=> object(stdClass)#5254 (2) {...
asked by 04.11.2016 / 19:30
1
answer

Handle an array key?

I need to manipulate a key that is passed as a parameter in this query : $Read->FullRead("SELECT DISTINCT ".DB_CONTAS." WHERE contas_status = 1 '{$FilterAdd} ", "{$FilterValues}");' The var_dump {...
asked by 04.01.2017 / 20:48
2
answers

String reading with two or more names

How do I read a string with a compound name for example: "Vitor Martins"? I'm doing this program that stores a student's name and grade, but it gives a bug when entering two names. #include<stdio.h> #include<string.h>...
asked by 24.09.2016 / 15:58
2
answers

Problem in printing a vector

Personal I have a basic problem that I can not understand the error: Proof Class: public class Prova { public static void main(String[] args) { Vetor lista = new Vetor(); Scanner scan = new Scanner(System.in); int codigo, ida...
asked by 10.09.2016 / 01:36