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
Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
Simora [160]

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       //Prompt and receive the three Scores

       int score1;

       int score2;

       int score3;

       do {

           System.out.println("Enter first Score Enter score between 1 -50");

           score1 = in.nextInt();

       } while(score1>50 || score1<0);

       do {

           System.out.println("Enter second Score.The second score must be between 1 -50");

           score2 = in.nextInt();

       } while(score2>50 || score2<0);

       do {

           System.out.println("Enter Third Score Third score must between 1 -50");

           score3 = in.nextInt();

       } while(score3>50 || score3<0);

       //Find the minimum of the three to drop

       int min, min2, max;

       if(score1<score2 && score1<score3){

           min = score1;

           min2 = score2;

           max = score3;

       }

       else if(score2 < score1 && score2<score3){

           min = score2;

           min2 = score1;

           max = score3;

       }

       else{

           min = score3;

           min2 = score1;

           max = score2;

       }

       System.out.println("your entered "+max+", "+min2+" and "+min+" the min is");

       int total = max+min2;

       System.out.println("Total of the two highest is "+total);

       //Finding the grade based on the cut-off points given

       if(total>=90){

           System.out.println("Grade is A");

       }

       else if(total>=80){

           System.out.println("Grade is B");

       }

       else if(total>=70){

           System.out.println("Grade is C");

       }

       else if(total>=60){

           System.out.println("Grade is D");

       }

       else{

           System.out.println("Grade is F");

       }

   }

}

Explanation:

  • Implemented with Java
  • Use the scanner class to receive user input
  • Use a do.....while loop to validate user input for each of the variables. A valid score must be between 0 and 50 while(score>50 || score<0);  
  • Use if and else to find the minimum of the three values and drop
  • Add the two highest numbers
  • use if/else if /else statements to print the corresponding grade
8 0
2 years ago
There is a file "IT4983" in my home (personal) directory. I don’t know my current working directory. How can I find out the file
RoseWind [281]

Answer and Explanation:

Find / -name "IT4983"

See what it will do is it will find the file named IT4983 in the root directory.

run this commmand with sudo just in case for permission issues.

then it will give you the location of that file we want to find.

 

Or

$ file /home/IT4983 ( you can type this command from whichever directory you are )

output : IT4983 , ASCII TEXT

3 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
marysya [2.9K]

Answer:

A Standard Lens

Explanation:

Since David wants to take pictures of people around him and also the objects far away, a standard lens would be fit for that.

3 0
2 years ago
A router is involved in ____________ layers of the tcp/ip protocol suite.
GenaCL600 [577]
Network Layer of the TCP/IP protocol
3 0
2 years ago
n the video, McWhorter says that “textspeak” might be a good thing for young people’s brains. Why does he think this?
ANEK [815]

As you may know people learn in different ways. Some learn by audio, hands on, and simply just reading. When he says textspeak it more than likely means the text will be read to you in a way you would understand better.

3 0
2 years ago
Other questions:
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • Mark T for True and F for False. No single person or government agency controls or owns the Internet. The W3C is responsible for
    5·1 answer
  • You're the sole IT employee at your company. Most of the computers in your fleet are Windows machines. Your boss wants you to se
    11·1 answer
  • What technology gets its name from the notion that it ignores the traditional A, B, and C class designations for IP addresses?
    14·1 answer
  • Create a class called Date that includes three pieces of information as instance variables—a month (type int), a day (type int),
    11·1 answer
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • In Java please.
    12·1 answer
  • Janice has a "jammed" key on her keyboard. Every time she strikes the "S" key it sticks and doesn't pop back. What should Janice
    6·2 answers
  • In an executing process, the program counter points __________.
    15·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!