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
Diano4ka-milaya [45]
2 years ago
15

When you pass an array as an argument to a function, the function can modify the contents of the array?

Computers and Technology
1 answer:
taurus [48]2 years ago
8 0
In most languages. Primitive data types ( char, int, float, bool, maybe string ) are usually passed by value, but compound data types are passed by reference, so you're not working on a copy but on the original.
You might be interested in
Which of the following is a true statement about psychological tests administered by computers? computers make standardization e
Hitman42 [59]
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
the true statement about psychological tests administered by computers is 
<span>most people find computerized tests to be difficult to understand. </span>
7 0
3 years ago
"write a program to play and score the paper-rock-scissor game. each of two users types in either p, r, or s. the program then a
algol13

The program is an illustration of conditional statements.

Conditional statements are used to execute instructions, if and only if certain <em>condition or conditions </em>are met.

Take for instance: <em>If b = 5, print "ab"</em>

The above print statement will only be executed, if the <em>value of b is 5</em>

The paper-rock-scissor program in Python where comments are used to explain each line is as follows,  

#This imports the random module

import random

#This is used to control the repetition of the game

playagain ="T"

#The following is repeated until the user chooses not to play again

while(playagain == "T"):

   #This generates a random choice for the computer

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

   #This gets input for the player

   player = input('Choose: ')

   #If the player and computer choose the selection

   if player == computer:

       #Then, it's a tie

       print('A tie - Both players chose '+player)

   #If the player wins

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

       #This prints "player won" and the reason

       print('Player won! '+player +' beats '+computer)

   #If otherwise,

   else:

       #This prints "computer won" and the reason

       print('Computer won! '+computer+' beats '+player)

   #This asks if the player wants to play again

   playagain = input("Play again? T/F: ")

At the end of each round,

  • The program displays the winner
  • Or prints a tie, if there's a tie

See attachment for sample run

Read more about conditional statements at:

brainly.com/question/22078945

8 0
2 years ago
What is the type of data in the list [103, 405, 527, 396, 503]?
Mariulka [41]

Answer:

alphanumeric.........

3 0
2 years ago
Read 2 more answers
Is there anybody who knows eris quirk but me- i feel lonely rn ;-;
Nutka1998 [239]

Answer:i do Eri's Quirk allows her to rewind an individual's body to a previous state. She has shown the ability to rewind someone's body to a point before they existed, which she accidentally did to her father.

3 0
3 years ago
Read 2 more answers
Write a program that asks the user for several days' temperatures and computes the average temperature for that period and how m
elena-14-01-66 [18.8K]

Answer:

#section 1

<em>no_of_days= int(input('How many days are we geting the average for: ')) </em>

<em>tem=[] </em>

<em>for i in range(no_of_days): </em>

<em>    a= int(input('Enter temperaure: input ' + str(i+1)+'  :')) </em>

<em>    tem.append(a) </em>

<em />

#section 2<em>     </em>

<em>average = round(sum(tem)/len(tem),2) </em>

<em>print('The Average is ',average) </em>

<em>gdays=[] </em>

<em>for i in tem: </em>

<em>    if i > average: </em>

<em>        gdays.append(i) </em>

<em> </em>

<em>print('The following days are greater than the average: ',gdays)</em>

Explanation:

The above code is written in python 3

#section 1:

An input is gotten for number of days that is to be used in the calculation, and an array is created to hold the temperature that will be inputted into the program.

A range of values from [0 - (no_of_days - 1)] is created from the number of days entered, this is done so that the FOR loop can iterate through every number and call for inputs.

The FOR loop prompts the user for an input based on the range and passes that input to an integer data type before appending it to the tem array.

#section 2:

The sum of the new list and the length is used to calculate the average and the it is rounded up to 2 DP, The average is then printed to the screen.

Another FOR loop is used to check which of the days are greater than the average and passes it to another array (<em>gdays)</em>, this array is also printed to the screen.

check the attachment to see how the code works.

4 0
3 years ago
Other questions:
  • How can you find Web pages that contain news published during the past week?
    8·1 answer
  • Processing is handled by the computer’s central processing unit (cpu).​ <br> a. True <br> b. False
    6·1 answer
  • _____ documentation is designed to help programmers and systems analysts understand the application software and maintain it aft
    12·1 answer
  • Which are valid double statements for java? double a = 0; double b = -1.0; double c = -425; double d = 6340; double e = -1.0; do
    12·2 answers
  • The most common types of utility programs fall into these categories. accessibility calculation communication data entry enterta
    6·2 answers
  • printLarger is a method that accepts two int arguments and returns no value. Two int variables, sales1 and sales2, have already
    11·1 answer
  • An article explaining the uses of the parts of a computer​
    14·1 answer
  • What study skill is being used when taking a large project and breaking it down into smaller manageable tasks?
    5·2 answers
  • Describe comm<br>unication cycle​
    15·2 answers
  • PLEASE ANSWER! I NEED IN 30 MIN.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!