answer.
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
Pani-rosa [81]
2 years ago
5

He volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called pr

int_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.

Include all of the following in your Learning Journal:

The code for your print_volume function.
The inputs and outputs to three calls of your print_volume.

Part 2

Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.

Include all of the following in your Learning Journal:

The code for the function that you invented.
The inputs and outputs to three calls of your invented function.
A description of what feature(s) your function illustrates.
Computers and Technology
1 answer:
AfilCa [17]2 years ago
5 0

Answer:

1) # function to print volume of a sphere

  def print_volume(radius):

   volume= (4/3)*3.14*radius*radius*radius

   print("Volume:{0}",volume)

print_volume(4.23)

print_volume(4.34)

print_volume(12.34)

Output:

Volume:{0} 316.8761018400001                                                                                                  

Volume:{0} 342.24536341333334                                                                                                  

Volume:{0} 7867.085384746666    

2) # area of square calculator

def print_area(length):

   area=length*length

   print("Area of Square{0}",area)

print_area(4.23)

print_area(4.34)

print_area(12.34)

Output:

Area of Square{0} 17.892900000000004                                                                                          

Area of Square{0} 18.8356                                                                                                      

Area of Square{0} 152.2756

Explanation:

We have created two functions, first to calculate the volume of a sphere. and second to calculate the area of a square. Remember pi=3.14.

You might be interested in
Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
VikaD [51]

Answer:

I would say that if she is connected to the server and has grained access to the server, Wendy would have to use the command shortkey win+r (to run) or she could just use the "Type here to search" function.

Then you can type the words "cmd" to bring up the command prompt

Lastly, she would need to use the protocol scp to transfer files. Wendy might need to include a destination for the files to be directed to.

7 0
2 years ago
Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
Kipish [7]

Answer:

The purpose of the Java compiler is to translate source code into instructions  public static void main(String[] args)  Arity is the number of arguments passed to a constructor or method or the number ... and objects, which are the focus of object-based programs.  Remove the 2 from between the square brackets to make.

Explanation:

5 0
2 years ago
Strlen("seven"); what is the output?
Leokris [45]

Answer:

A is your answer hope this helps

4 0
2 years ago
Which formula would you enter into C3, and then AutoFill into C4 through C6, to calculate the percent sales (Pct.) for the regio
inna [77]

Answer:

In C3, you would enter the formula:

  • =B3/$B$7%

Explanation:

Let's assume the first row is 1 and it contains the titles of the columns.  For instance, the content of the cellss A1:C1 could be:

  • A1: Region
  • B1: Sales
  • C1: Percent Sales

Also, assume the second row is empty and the cells on the first column, A, contain the names of four regions. For instance, North, South, East, and West:

  • A3: North
  • A4: South
  • A5: East
  • A6: West

The cells B3:B6 contain the sales for the four regions. For instance:

  • B3: 200
  • B4: 300
  • B5: 100
  • B6: 400

Then, you must calculate the percent sales for every region, in the cells <em>C3:C6.</em>

That means, you must divide the sale of every region by the total of sales and multiply by 100.

To do that in the worksheet you do this:

<u>1. Sum the sales for the regions:</u>

  • In cell B7 introduce: =SUM(B3:B6)

<u>2. Calculate the percent sale for the first region:</u>

  • In cell C3 introduce: =B3/$B$7%

That means that the reference B3 is relative: when you copy that formula, the column (B) and the row (3) will change accordingly to the cell where you will copy it.

Thus, by using the Autofill into C4 through C6, the column wil remain unchanged (C) and the row will change to 4, 5, and 6, respectively.

The symbol $ used in $B$7 make the reference absolute. That means that they will not change. The symbol % makes that the result is multiplied by 100.

<u>3. When you use Autofull into C4 through C6, you obtain:</u>

  • C4: =B4/$B$7%
  • C5: =B5/$B$7%
  • C6: =B6/$B$7%
4 0
2 years ago
Emulated drivers provide enhanced drivers for the guest OS and improve performance and functionality for IDE and SCSI storage de
Vikki [24]

Answer:

The answer is "Option 2".

Explanation:

  • All the other drivers replicate even existing technical embedded devices. These systems have optimistic, and they are commonly accessible to inbox operators as most web browsers. It is an Imitated device, that performance problems because of all the emulator is the workload.
  • Integration Services  is a program package, which is created on a guest OS of a VM, that provides enhanced guest OS drivers and improves accuracy, functionality for IDE and SCSI storage systems, networking interfaces, and monitor and multimedia devices, that's why it is incorrect.

8 0
2 years ago
Other questions:
  • A two-dimensional array can have elements of ________ data type(s).
    7·1 answer
  • The bit width of the LRU counter for a 32 KB 16-way set associative cache with 32 Byte line size is
    13·1 answer
  • Explain how buyers and sellers factor into setting the stock price for a company’s shares.
    13·1 answer
  • A method countDigits(int num) of class Digits returns the remainder when the input argument num(num &gt; 0) is divided by the nu
    10·1 answer
  • Suppose a computer using direct mapped cache has 220 bytes of byte-addressable main memory, and a cache of 32 blocks, where each
    5·1 answer
  • Your network administrator finds a virus has been successfully inserted into the network software. The virus itself is now consi
    10·2 answers
  • Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the
    7·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C++, division by zero is always an error. Given a int variable named
    9·1 answer
  • Write a program that plays a reverse guessing game with the user. The user thinks of a number between 1 and 10, and the computer
    5·1 answer
  • Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lowe
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!