1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Effectus [21]
3 years ago
15

True/False: When you make a function call, the order of the arguments you send does not matter as long as the number of argument

s matches the number of parameters the function has. True False
Computers and Technology
1 answer:
EleoNora [17]3 years ago
5 0

Answer:

False

Explanation:

The order of arguments sent matters because what if you were trying to assign a int parameter as string, moreover there is one to one mapping and thus the results computed by the function will be wrong too. The order may cause a bug in the functionality (when the wrong value is assigned to the wrongly selected parameter due to alteration in order), cause run time errors ( when the data type of parameter and argument does not match due to alteration in order )

You might be interested in
Given the following function definition
siniylev [52]

Answer:

B. 1 6 3

Explanation:

Given function definition for calc:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

Function invocation:

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

  • Since x is passed by value, its value remains 1.
  • y is passed by reference to the function calc(x,y);

Tracing the function execution:

c=3

a=3

b=c+a = 6;

But b actually corresponds to y. So y=6 after function call.

  • Since z is not involved in function call, its value remain 3.

So output: 1 6 3

3 0
2 years ago
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

  for(i = 0; i < n; i++)

  {

      sum = sum + arr[i]; //count sum

  }  

  for(i = 0; i < n; i++)

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

  for(i = 0; i < n; i++)

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
With working from home now becoming a norm what is an effective network for an organization to secure its internal resources acc
Umnica [9.8K]

Answer:

Always encrypt data never store anything in plain text someone could use wireshark to pull out a data packet and if the data is not encrypted, expect things to happen.

4 0
2 years ago
Define a member function PrintAll() for class PetData that prints output as follows. Hint: Make use of the base class' PrintAll(
PilotLPTM [1.2K]

Answer:

Following are the program in the C++ Programming Language.

//set header file

#include <iostream>

//set header file for string

#include <string>

//set namespace

using namespace std;

//define class

class AnimalData

{

//set access modifier

public:

//define function

void SetName(string givenName)

{

//initialize the value of function's argument

fullName = givenName;

};

//define function

void SetAge(int numYears)

{

//initialize the value of function's argument

ageYears = numYears;

};  

//here is the solution

//define function

void PrintAll()

{

//print output with message

cout << "Name: " << fullName<<endl;

//print output with message

cout << "Age: " << ageYears<<endl;

};

//set access modifier

private:

//set integer data type variable

int ageYears;

//set string data type variable

string fullName;

};

//define class and inherit the parent class

class PetData: public AnimalData

{

//set access modifier

public:

//define function

void SetID(int petID)

{

idNum = petID;

};

//override the function for print id

void PrintAll()

{

AnimalData::PrintAll();

cout << "ID: " <<idNum ;

};

//set access modifier

private:

//set integer type variables

int idNum,fullName,ageYears;

};

//define main method

int main()

{

//create object of the child class

PetData userPet;

//call function through object

userPet.SetName("Fluffy");

//call function through object

userPet.SetAge (5);

//call function through object

userPet.SetID (4444);

//call function through object

userPet.PrintAll();

cout << endl;

return 0;

}

<u>Output</u>:

Name: Fluffy

Age: 5

ID: 4444

Explanation:

<u>Following are the description of the program</u>:

  • Set required header file and namespace.
  • Define class 'AnimalData' and inside the class, set integer data type variable 'ageYears', string data type variable 'fullName'.
  1. Then, define function 'SetName()' with string data type argument 'givenName' and initialize the value of argument in the string variable.
  2. Then, define function 'SetAge()' with integer data type argument 'numYears' and initialize the value of the argument in the integer variable.
  3. Define function 'PrintAll()' to print the value of the following variables with message.
  • Define class 'PetData' and inherit the parent class in it, then set integer data type variable 'idNum'.
  1. Then, define function 'SetID()' with integer data type argument 'petID' and initialize the value of the argument in the integer variable.
  2. Override the function 'PrintAll()' to print the value of the following variable with message.

Finally, define main method and create the object of the child class, then call the following functions through the class object.

8 0
2 years ago
Application software solve application programs true or false​
asambeis [7]

Answer: False

Explanation: Application software, on the other hand, refers to software that is designed to perform a certain task. It's just a collection of programs that customers can use.

8 0
2 years ago
Other questions:
  • What should a career plan include?
    7·1 answer
  • What is the definition of a WAP?
    6·2 answers
  • In real-world environments, risks and their direct consequences will most likely span across several domains. However, in the la
    12·1 answer
  • All web page urls begin with the letters ____.
    6·1 answer
  • For the past three years, the interviews conducted at Gavallet, an e-commerce site, have been following the same pattern. Candid
    9·1 answer
  • What is the value of 8n when n= = 2?​
    13·1 answer
  • A town government is designing a new bus system. The planners are deciding where to put the different bus stops. They want to pi
    6·2 answers
  • Another way to create a new presentation is from the Home tab
    6·2 answers
  • As Jane was setting up her projector, she realized that the images on the screen appeared blurred. How would Jane sort out the i
    6·2 answers
  • Mathematics and computer science share many concepts, such as recursion.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!