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
Ne4ueva [31]
3 years ago
9

The volume of a sphere is 4/3πr3, where π has the value of "pi". Write a function called print_volume (r) that takes an argument

for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
Computers and Technology
1 answer:
Marizza181 [45]3 years ago
6 0

Answer:

In Python:

def print_volume (r):

   volume = 4/3 * 3.142*r**3

   print(volume)

print_volume(7)

print_volume(14)

print_volume(22)

Explanation:

This defines the function and takes radius r as the parameter

def print_volume (r):

This calculates the volume

   volume = 4/3 * 3.142*r**3

This prints the volume

   print(volume)

The next three lines call the function with different values

<em>print_volume(7)</em>

<em>print_volume(14)</em>

<em>print_volume(22)</em>

You might be interested in
could someone plz enplane to me what iOS r because i go to donlaod a app on my phone and it says i need to upgrade to a iOS 8.0
Nezavi [6.7K]
If it says that you may need to do updates
8 0
4 years ago
Read 2 more answers
Consider the following code segment. int[][] arr = {{3, 2, 1}, {4, 3, 5}}; for (int row = 0; row &lt; arr.length; row++) { for (
ludmilkaskok [199]

Answer:

Condition one - 1 time

Condition two - 2 times

Explanation:

Given

The above code segment

Required

Determine the number of times each print statement is executed

For condition one:

The if condition required to print the statement is:  <em>if (arr[row][col] >= arr[row][col - 1]) </em>

<em />

For the given data array, this condition is true only once, when

row = 1  and  col = 2

i.e.

<em>if(arr[row][col] >= arr[row][col - 1]) </em>

=> <em>arr[1][2] >= arr[1][2 - 1]</em>

=> <em>arr[1][2] >= arr[1][1]</em>

<em>=> 5 >= 3 ---- True</em>

<em />

The statement is false for other elements of the array

Hence, Condition one is printed once

<em />

<em />

For condition two:

The if condition required to print the statement is:  <em>if (arr[row][col] % 2 == 0) </em>

<em />

The condition checks if the array element is divisible by 2.

For the given data array, this condition is true only two times, when

row = 0  and  col = 1

row = 1  and  col = 0

i.e.

<em>if (arr[row][col] % 2 == 0) </em>

<em>When </em>row = 0  and  col = 1

<em>=>arr[0][1] % 2 == 0</em>

<em>=>2 % 2 == 0 --- True</em>

<em />

<em>When </em>row = 1  and  col = 0

<em>=>arr[1][0] % 2 == 0</em>

<em>=> 4 % 2 == 0 --- True</em>

<em />

<em />

The statement is false for other elements of the array

Hence, Condition two is printed twice

3 0
3 years ago
Match the following Microsoft Windows 7 ​
Dominik [7]

Answer:

Explanation:  will be still function but Microsoft will no longer provide the following: Technical support for any issues

6 0
3 years ago
Which loan type requires you to make loan payments while you’re attending school?
mixer [17]
Direct Subsidized Loans<span> are available only to undergraduate students who have financial need. Direct Unsubsidized </span>Loans<span> are available to both undergraduates and graduate or professional degree students. </span>You<span> are not </span>required<span> to show financial need to receive a Direct Unsubsidized </span>Loan<span>.

Hope this answer helps! feel free to ask any additional questions :)</span>
4 0
3 years ago
When was the bible of luke written​
Gelneren [198K]
85 C.E. I think that is when it was written, but I’m not 100% sure.
3 0
3 years ago
Other questions:
  • Write a literal representing the false value in c++.
    11·1 answer
  • We are tall straight and upright who are we
    7·2 answers
  • Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operation
    14·1 answer
  • An ideal line length would include how many characters? A. 6570 B. 100 C. 100125 D. 4055
    8·1 answer
  • (true/false) In a layered operating system design, requests (such user processes may need to interact with multiple layers, resu
    14·1 answer
  • Write a program called DeliveryCharges for the package delivery service in Exercise 4. The program should again use an array tha
    9·1 answer
  • What language below is used to view and manipulate data that is stored in a relational database?
    6·1 answer
  • During the Inspect and Adapt event, how are reflection, data collection, problem solving, and identification of improvement acti
    5·1 answer
  • Consider a file/directory with the following info:
    14·1 answer
  • Founder of television and Radio​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!