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
Write a loop that outputs the numbers in a list named salaries. The outputs should be formatted in a column that is right-justif
GalinKa [24]

Answer:

Following is the loop statement in the Python programming language

salaries=[93.85967,4232.32,13343.3434] #storing the values in salaries

for k in salaries:#iterating the loop

   print("%12f"%round(k,2))# print the width of 12 and a precision of 2

   Output:

  93.860000

4232.320000

13343.340000

Explanation:

Following is the description of the statement

  • Declared a dictionary "salaries" and initialized some values into it.
  • iterating the for a loop .
  • In this for loop print the width 12 and a precision of 2 .The print statement in python will
  •  print the data with  width 12 and a precision of 2 in the console window

7 0
2 years ago
Which XXX and YYY correctly output the smallest values? Vector user Vals contains integers (which may be positive or negative).
liubo4ka [24]

Answer:

The answer is "minVal - userVals.at(0); /userVals.at(i) < minVal  "

Explanation:

In the question, it uses minVal instead of XXX to hold the very first arra(userVal) element, and rather than YYY you choose a conditional statement to check which integer is lower than minVal to index of loop increment. It changes the value of the minVal if the condition is valid. It's completely different if we talk about another situation.

3 0
1 year ago
3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
Burka [1]

Answer:

The upgrade is possible and it will yield a remarkable  increase in performance

Explanation:

It is a newer product, there is tendency of having a better application compatibility/performance

It has much higher multi threaded performance which is around 522% higher. This allows for higher performance in professional applications like encoding and heavy multitasking compared to the previous.

When considering gaming, it has higher performance compared to the previous.

5 0
2 years ago
3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a
Taya2010 [7]

Answer:

// program in C++ to check leap year.

// include header

#include<iostream>

using namespace std;

// main function

int main() {

// variable

  int inp_year ;

  // ask user to enter year

  cout<<"Enter year:";

  // read year

  cin>>inp_year;

  // check year is leap or not

  if (((inp_year % 4 == 0) && (inp_year % 100 != 0)) || (inp_year % 400 == 0))

  // if leap year , print leap year

     cout<<inp_year<<" is a leap year.";

  else

  // print not leap year

     cout<<inp_year<<" is not a leap year.";

  return 0;

}

Explanation:

Read year from user.Then check if year is divisible by 4 and not divisible by 100 or year is divisible by 400 then year is leap year.otherwise year is not  leap year.

Output:

Enter year:1712                                                                                                            

1712 is a leap year.

6 0
2 years ago
Read 2 more answers
In the game Singularity, broken objects can be restored to their original condition by reversing time. This is an example of whi
Zolol [24]

Solution:

In the game Singularity, broken objects can be restored to their original condition by reversing time. This is an example of which time element of player adjustment.

Thus the required answer is player adjusted.

6 0
2 years ago
Read 2 more answers
Other questions:
  • Name an analog quantity other than temperature and sound.
    14·1 answer
  • Which statement regarding dialogues in multiplayer games is true? Dialogues are based only on players’ actions.
    7·2 answers
  • Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
    6·1 answer
  • What are common names for some primary discrete components used on circuit boards?
    13·1 answer
  • 3.5 Code Practice
    11·2 answers
  • Consider the following relationship involving two entities, students and classes:A student can take many classes. A class can be
    9·1 answer
  • Write a program to determine all pairs of positive integers, (a, b), such that a &lt; b &lt; 1000 and [a2 + b2 + 1)/(ab) is an i
    13·1 answer
  • The following checksum formula is widely used by banks and credit card companies to validate legal account numbers: d0 + f(d1) +
    13·1 answer
  • Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the
    8·1 answer
  • Which argument forces a writer to return to and change the input before resolving a “UnicodeError”?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!