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
viktelen [127]
3 years ago
8

A program contains the following function definition: int cube(int number) { return number * number * number; } Write a stateme

nt that calls this function, passing the value 4 as an argument, and assigns the function's return value to the variable result.
Engineering
1 answer:
Nonamiya [84]3 years ago
8 0

Answer:

The statement can be written as

int result = cube(4);

Explanation:

A function is a block of reusable codes to perform some tasks. For example, the function in the question is to calculate the cube of a number.

A function can also operate on one or more input value (argument) and return a result. The <em>cube </em>function in the question accept one input value through its parameter <em>number </em>and the <em>number</em> will be multiplied by itself twice and return the result.  

To call a function, just simply write the function name followed with parenthesis (e.g. <em>cube()</em>). Within the parenthesis, we can include zero or one or more than one values as argument(s) (e.g. <em>cube(4)</em>).

We can then use the "=" operator to assign the return output of the function to a variable (e.g. <em>int result = cube(4)</em>)

You might be interested in
How can statistical analysis of a dataset inform a design process
Shtirlitz [24]

Answer:

Explanation:.

3 0
2 years ago
What are the main microsoft ware packages widely used today​
RSB [31]

Answer:

» Microsoft word ( word processing )

» Microsoft powerpoint ( presentation )

» Microsoft access ( database mamagement )

» Microsoft excel ( spread sheets )

Explanation:

.

7 0
2 years ago
Read 2 more answers
Why did you choose agricultural and biosystem as a course? Help me guys
Mazyrski [523]

Answer:

To be able to develop as a human and give back to the community. To ensure that people have safe food and water to drink, clean fuel and energy sources, and in general a safe enviornment to live in.

Explanation:

7 0
2 years ago
python Write a program that asks a user to type in two strings and that prints •the characters that occur in both strings. •the
Yuliya22 [10]

Answer:

see explanation

Explanation:

#we first get the elements as inputs

x = input("enter string A :")

y = input("enter string B :")

#then we make independent sets with each

x = set(x)

y = set(y)

#then the intersection of the two sets

intersection = set.intersection(x,y)

#another set for the alphabet

#we use set.difference to get the elements present in x and not in y, and

#viceversa, finally we get the difference between the alphabet and the #intersection of the elements in our strings

z = set('abcdefghijklmnopqrstuvwxyz')

print('\nrepeated :\n',intersection)

print('differences :\n',' Items in A and not B\n',

set.difference(x,y),'\nItems in B and not A\n',

set.difference(y,x))

print('\nItems in neither :\n',set.difference(z,intersection))

8 0
3 years ago
What type of foundation do engineers use for a small and light building and when the load of the building is borne by columns? A
ikadub [295]

Answer:

A.

Explanation:

Individual footings are the commonest, and they are often used if the load of the building is borne by columns. Typically, every column will have an own footing. The footing is usually only a rectangular or square pad of concrete on which the column is erected

8 0
2 years ago
Other questions:
  • An inflatable structure has the shape of a half-circular cylinder with hemispherical ends. The structure has a radius of 40 ft w
    6·1 answer
  • The enthalpy of the water entering an actual pump is 500 kJ/kg and the enthalpy of the water leaving it is 550 kJ/kg. The pump h
    10·1 answer
  • When fermentation units are operated with high aeration rates, significant amounts of water can be evaporated into the air passi
    13·1 answer
  • What was the purpose of the vasa ship
    11·1 answer
  • 1. Asphyxiation is a hazard posed by Compressed Natural Gas (CNG) vehicles and can be detected when you notice
    7·1 answer
  • A local surf report provides the height of the wave from the trough to the crest of the wave. How does this relate to the wave’s
    11·1 answer
  • Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 12.00
    13·1 answer
  • Principals of Construction intro
    11·1 answer
  • Consider a single crystal of some hypothetical metal that has the FCC crystal structure and is oriented such that a tensile stre
    7·1 answer
  • Time left 0:35:32 Three steel rod (E = 200 GPa) supports 36 KN Load P. Each of the rods AB and CD has a 200 mm? cross- sectional
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!