Most voted "function" questions
The function (also called procedure, method, subprogram, or routine) is a portion of code intended to perform a single, specific task.
Learn more…1,309 questions
Sort by count of
-
0
votes1
answer1084
viewsSum of the elements of the secondary diagonal of a matrix
I made a program that the user declares the size of the matrix, and the matrix numbers are random. But in the sum part does not work and displays many errors. Java public static void main ( String[]…
-
0
votes1
answer44
viewsHow to use function to sum 3 matrices
I’m having trouble creating a function. I have my program ready, but I’m doing an exercise where the function is mandatory and I’m not getting. Java public static void main(String[] args) { Random…
-
0
votes1
answer50
viewsMultiplication of 3 matrices
I have to multiply three matrices with the validation that you can actually do, in one function. I’m trying to do matrix 1 and 2 first and get the result to do the 3. But it’s going wrong and also I…
-
0
votes0
answers21
viewsHow to Stop This Observable "unsubscribe"
Looking for a way to receive data inside a setTimeout, to do what you need and or stop your replay, I thought about creating a file, so when I receive the then or catch of this function, I stop the…
-
0
votes0
answers17
viewsAbout Pygame, I need a picture to get smaller and soon dps return to their normal size, cm a button being pressed for example
My main problem is that when I create a function to get the image back to normal size, instead of it shrinking back to normal, it simply skips the step of shrinking the image. (it does not have the…
-
0
votes2
answers59
views -
0
votes1
answer44
viewsTransform and return a centered string s into a length width string
In this exercise I must pass to the function a string, a size and the character I want to include in the string, but I find problems when executing it, the string that should be centered ends up…
-
0
votes0
answers42
viewsDuplicate the last line of the file . txt c++
#include <fstream> #include <vector> using namespace std; struct Produto { string nomeProduto,quantidade,marca,preco; }; void carregaProdutos(vector<Produto> &R) { ifstream…
-
0
votes0
answers28
viewsWebsocket Javascript - multiple simultaneous connections
Personal talk, I have a function where I make a connection with a websoket, I can connect and everything, only I’m wanting to open 3 connections from 3 different users, I can open these connections…
-
0
votes0
answers21
viewsDoubt with use of Geoposition
Good morning, I don’t have much practice with Javascript (I had contact only during a period at CEDERJ). Now I need the blessed one, and I’m not getting out of a situation. I’m going to post the…
functionasked 4 years ago janir.matheus 1 -
0
votes1
answer49
viewsCan someone help me with this exercise?
EXERCISE: Write a function that returns the number of the team that is in the lead. Leadership is determined by the team that has the most points won. If one or more teams have the same number of…
-
0
votes1
answer88
views"Expected Primary-Expression before 'float'", calling a function from another class
I need to create a Florentzproton function in the Physics class that takes two vectors (v and B) and multiply them using another Productovetorial function, of the Mathematics class, storing the…
-
0
votes0
answers29
viewsHow to access the Python-Shell output outside the function scope
Hello! I’m making an api using Python in the back-end as the python script is all ok! I will receive a sentence in Javascript and through python-shell I will process it in python, until there is a…
-
0
votes0
answers53
viewsC language problem with queues and write to text file
I have a college job to do, but I have a lot of difficulty in language C the job is to create the following functions int InserirAviaoFila(char *voo); int MostrarFila(); int AutorizarDecolagem();…
-
0
votes1
answer247
viewsHow to resolve Uncaught Typeerror: Hidden is not a Function at Htmlbuttonelement.onclick?
I have a javascript file with this code: const newTopic = document.getElementById('topic'); const introduction = document.getElementById('introduction'); function hidden(){…
-
0
votes0
answers37
viewsfunction does not work within setInterval within another function
Hello, I started studying Javascript a little while ago, and I always get excited when I go to mess with kk functions, I’m trying to create a stopwatch with JS and HTML, but when I create the…
-
0
votes0
answers43
viewscreating a dataframe from pairs of columns in Python
Using the yfinance library I imported data from a list of 80 assets: tickers=['xxx','yyy'] data = yf.download(tickers, start="2020-01-01", end="2020-12-04") data = data['Close'] I used a function…
-
0
votes2
answers152
viewsOrdering values by pointers
Good, I was doing an exercise that asked to read 3 real numbers, order them and show in an orderly way. I thought making a function that uses pointers would be a good idea, but the program always…
-
0
votes1
answer41
viewsFatal error: Call to Undefined Function query
Can someone help me with this mistake: Fatal error: Call to Undefined Function query() My code: <html> <head> <meta charset="UTF-8"> <title> Perfil Candidato(a) !…
-
0
votes2
answers364
viewsHow to calculate the number of times a word appears within a sentence
I’m trying to create a code in which I have to count the number of times a word appears within a sentence, but after a lot of searching and searching about, I can only find codes that use the fgets…
-
0
votes1
answer101
views"Error: cannot set Property appendchild() of null
In my code I made a function to create a button and right after the user click on it the button and the other altered content are deleted. I managed to reach that point, but button is at the end of…
-
0
votes1
answer48
viewsin C. I passed a vector to a function and changed it inside. Why didn’t you change my vector in the main function? because I passed a pointer
#include <stdlib.h> void matriz_transposta( int l, int c, int *matriz); int main (void){ int linha = 2, coluna = 2; int *mat = (int*)…
-
0
votes1
answer86
viewsCan anyone help me choose a specific line from the matrix ? (c/c++ language)
I’m doing an activity and she says: (function - matrix and vector) Design a program that reads a 4x4 matrix and creates a 4-element vector consisting of the elements of a matrix line chosen by the…
-
0
votes0
answers12
viewsUse of Delete and get in crontab
Closed. This question is out of scope and is not currently accepting answers. Despite being about programming, this question does not seem to meet the minimum criteria of quality and detail for a…
-
0
votes0
answers18
viewsAzure Function Queue, how to pick up 1 dice at a time?
Hello, good(m) (day, afternoon, night) I am working with a Function that when activated makes a very heavy processing. Because of that I can’t let her pick up multiple dice in the queue, it needs to…
-
0
votes3
answers73
viewsDoubt about storing the function result in a list and the types of stored variables
Home Post I am making a simple code that gives me the variation % between two numbers, A and B. As soon as he calculates this variation %, he should attach the result of the operation in a list that…
-
0
votes1
answer36
viewsHow to return a pointer to a dynamically allocated String, declared within a function?
//Função de inversão de String. #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 30 char* invertStr(char *source) { int size = strlen(source); char *inverted…
-
0
votes1
answer24
viewsJava function does not return the correct value
I’m not getting the desired value from the recursive function below. I have tried putting a System.out.println to monitor the values of the cycleLength and n variables and the result was that for…
-
0
votes1
answer37
viewsHow can I make this calculation be performed in all the Objects of the array and return me the value multiplied by the length of the table?
I need the calculation to be performed in all Bjects before returning the value to me by the length of the table (OBS: it’s just a challenge I’m participating, I’m not using database). function…
-
0
votes1
answer77
viewsLink PHP to HTML and Calculate how old and months
I would like to know if it is possible and how I can link this html in php, adding the count of how many years and how many months a person has I also wanted a php function that shows the name when…
-
0
votes1
answer53
viewsHow to change formularies in different modules
I’m using Python 3.7 I have 2 forms (windows) that I made with Pyqt5, in one of them have some Labels that I need to change according to the settings window configuration. created a modules with the…
-
0
votes1
answer48
viewsI’m having a problem running a repeat on C
Description of the issue: "Implement the function below that takes a string and compresses it into a single character, any set of consecutive repeated characters." function: char *strpack(char *s)…
-
0
votes0
answers22
viewsProcedure not being performed in Portugol Studio
I created a code to receive the: names, age, sex and salary of 10 people, a function to sort the vectors according to the highest salary, and another function to return the names of the 5 best paid…
-
0
votes0
answers13
viewsI can’t get a variable out of a function
I’m trying to make a currency converter, but I can’t get the object out of the fetch, although I read this question don’t understand yet what I should do, I am obliged to make the conversion within…
-
0
votes1
answer28
viewsHow to treat a function value as an existing variable?
I’m making a simple game, just to test the Pygame library. It turns out that as in the game I would have several objects I found it more feasible to create a function to move them: def…
-
0
votes1
answer26
views(Function) Check filled fields return previous action
I have a function that checks whether the fields in my form have been filled or not picking by their value. If certain fields have been filled in and an action appears on progress. In this role I…
-
0
votes2
answers30
viewsEnable input with enter key
Good afternoon, esotu trying to create a login system and to enter the system by clicking the enter key on the keyboard, ends up redirecting to my "forgot my password" besides activating the key…
-
0
votes1
answer52
viewsTrigger Insert in the same table
Hello, I have a table where I keep records of movements, it is inserted a record where it is possible to inform a payment installment, for example, a purchase made in 12 times whose current…
-
0
votes0
answers46
viewsHow to change titles dynamically with javascript
Hi, how are you? I’m a beginner in javascript and created a simple html page listing the image name of some ps4 games to practice DOM, on the page I have the button of each game and its name and…
-
0
votes0
answers67
viewsSum function in SQL database
I need to create a user role (user function) which receives as input parameters a store identifier code and a category identifier code and returns as a result an integer value that informs the…
-
0
votes2
answers82
viewsDoubt with recursive function in C
Good night, you guys! I am performing an activity whose goal is to use a recursive function to perform a whole division only through successive subtractions. I made a while loop and only it (which I…
-
0
votes0
answers24
viewsThe same function in child elements. How to separate in Javascript?
Good morning. I want to create a function to open an external page by clicking. For example, html would look like this: <div class="pai"> <div class="filho"> <img class="jogo"…
-
0
votes2
answers59
viewsFunction in C that counts how many times the string appears in a file
I need to make a function that receives as parameters a pointer for a string and the name of a file and return to the main how many times the string was found in the file. I only managed to get her…
-
0
votes1
answer77
viewsSum checkbox with predefined values. Javascript
I’m trying to add value values that were selected via checkbox with pure Javascript. What I’m missing ? Follow the line of code I rationed ... HTML <h2>Escolha seus destinos:</h2>…
-
0
votes1
answer28
viewsTake an input value and play value in another input by Javascript
Good evening, I would need the user to choose how many classes you want in select and then the system will calculate the value and put in the other input, I don’t know where I’m going wrong if you…
-
0
votes0
answers47
viewsFunction to calculate higher percentage of hires per region in R
Hello, I am trying to make a function that returns the highest percentage (Taxas_in) of hires in a region (Local), and the output would be the sector (Activity) and the respective rate with the…
-
0
votes1
answer33
viewsFunction in R is not taking the parameter correctly
I am creating a function, but when calling the function, the parameter is not working when performing FILTER and SUM. To select the column or to perform an n() type count, it works correctly.…
-
0
votes1
answer56
viewsHow do I pick up two values obtained in a function through pointers?
I am building a program, whose enunciation is to make the user provide 20 numbers and these are analyzed as pairs or odd. In this case, the intention is to create a vector A that takes 20 integers…
-
0
votes0
answers29
viewsfilter a Json by date in javascript
I need to create the function that returns the expired boletos in relation to "data_expiration" and "30-07-2021" but I need to create this without changing the rest of the code beyond the existing…
-
0
votes0
answers36
viewsPointer pointer in C
Come on, guys, I’m trying to understand the pointer-pointer behavior, but I can’t figure it out. Well, I already have an idea that the pointer points the memory address of something, to another…