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
stira [4]
4 years ago
15

The surface area of a sphere can be computed by knowing only the radius of the sphere using the following relation: A = 4 π r 2

Unlike in previous questions where we wanted you to complete a function we had started, here we want you to write a Python function from scratch called surf_area_sphere that takes a single parameter, the radius of a sphere as a floating point number, and returns the surface area of that sphere. You can name your parameter whatever you want.
Computers and Technology
1 answer:
MrMuchimi4 years ago
8 0

Answer:

// program in Python.

#library

import math

#function to find surface area of sphere

def surf_area_sphere(rad):

   # calculate area and return it

   return 4*math.pi*rad**2

#read the radius of sphere

rad=float(input("Enter the radius of sphere:"))

#call the function to find the Surface area

s_area=surf_area_sphere(rad)

#print the Surface area

print("Surface area is:",s_area)

Explanation:

Read the radius of sphere from user and assign it to variable "rad".Then call the  function surf_area_sphere() with parameter "rad".This function will calculate the  surface area as "4*pi*r*r" and return it value.Then print the surface area of sphere.

Output:

Enter the radius of sphere:4                                                                                              

Surface area is: 201.06192982974676

You might be interested in
Explain different types of secondary memory of computer system<br>​
Westkost [7]

<em>Answer:</em>

<em>There are three main types of secondary storage in a computer system: solid state storage devices, such as USB memory sticks. optical storage devices, such as CD, DVD and Blu-ray discs. magnetic storage devices, such as hard disk drives.</em>

<em>Explanation:</em>

6 0
2 years ago
A(n) ____________________ attack is an assault on a network that floods it with so many additional requests that regular traffic
ki77a [65]

Answer:

Denial of Server or DoS

Explanation:

Have a nice day! :)

3 0
3 years ago
What is the name used for the camera’s view from a single position?
netineya [11]
A.A shot. 
hope this helps!!
5 0
4 years ago
Create an abstract class Homeowner. Your Homeowner class should include the following attributes: First name (string) Last name
serious [3.7K]

Answer:

import java.util.Scanner;

abstract class Homeowner

{

  private String firstName,lastName,streetAddress,city,state,county;

 

  public Homeowner(String firstName,String lastName,String streetAddress,String city,String state,String county)

  {

  this.firstName = firstName;

  this.lastName = lastName;

  this.streetAddress = streetAddress;

  this.city = city;

  this.state = state;

  this.county = county;

     

  }

 

  public abstract double propertyTaxes();

 

}

class countyNeighbor extends Homeowner

{

  private double propertyValue,countyTaxRate;

 

  public countyNeighbor(String firstName,String lastName,String streetAddress,String city,String state,String county,double propertyValue,double countyTaxRate)

  {

      super(firstName,lastName,streetAddress,city,state,county);

      this.propertyValue = propertyValue;

      this.countyTaxRate = countyTaxRate;

  }

  public double propertyTaxes()

  {

      return propertyValue * countyTaxRate;

  }

 

}

class Test

{

  public static void main (String[] args)

  {

      Scanner input = new Scanner(System.in);

     

      System.out.println("Enter firstName of the homeowner : ");

      String firstName = input.next();

      System.out.println("Enter lastName of the homeowner : ");

      String lastName = input.next();

      System.out.println("Enter streetAddress of the homeowner : ");

      String streetAddress = input.next();

      System.out.println("Enter city of the homeowner : ");

      String city = input.next();

      System.out.println("Enter state of the homeowner : ");

      String state = input.next();

      System.out.println("Enter county of the homeowner : ");

      String county = input.next();

      System.out.println("Enter propertyValue of the homeowner : ");

      double propertyValue = input.nextDouble();

      System.out.println("Enter countyTaxRate of the homeowner : ");

      double countyTaxRate = input.nextDouble();

     

      countyNeighbor cn = new countyNeighbor(firstName,lastName,streetAddress,city,state,county,propertyValue,countyTaxRate);

     

      System.out.println("Property Tax = $"+ cn.propertyTaxes());

     

     

      System.out.println("Enter firstName of the homeowner : ");

      firstName = input.next();

      System.out.println("Enter lastName of the homeowner : ");

      lastName = input.next();

      System.out.println("Enter streetAddress of the homeowner : ");

      streetAddress = input.next();

      System.out.println("Enter city of the homeowner : ");

      city = input.next();

      System.out.println("Enter state of the homeowner : ");

      state = input.next();

      System.out.println("Enter county of the homeowner : ");

      county = input.next();

      System.out.println("Enter propertyValue of the homeowner : ");

      propertyValue = input.nextDouble();

      System.out.println("Enter countyTaxRate of the homeowner : ");

      countyTaxRate = input.nextDouble();

     

      countyNeighbor cn1 = new countyNeighbor(firstName,lastName,streetAddress,city,state,county,propertyValue,countyTaxRate);

     

      System.out.println("Property Tax = $"+ cn1.propertyTaxes());

  }

}

Output:

Enter firstName of the homeowner : John

Enter lastName of the homeowner : Smith

Enter streetAddress of the homeowner : 345,downstreet  

Enter city of the homeowner : NY

Enter state of the homeowner : NY

Enter county of the homeowner : Albany  

Enter propertyValue of the homeowner : 56788.00  

Enter countyTaxRate of the homeowner : 0.07

Property Tax = $3975.1600000000003

Enter firstName of the homeowner : Cathy  

Enter lastName of the homeowner : Jones  

Enter streetAddress of the homeowner : 456,lane-2  

Enter city of the homeowner : NY  

Enter state of the homeowner : NY  

Enter county of the homeowner :  Bronx  

Enter propertyValue of the homeowner : 36762.00  

Enter countyTaxRate of the homeowner : 0.08

Property Tax = $2940.96

Explanation:

4 0
3 years ago
Which of the following statement about device formatting is FALSE?
notsponge [240]

Answer:

The correct option is;

A) Device manufacturers store the initial file-system data structures in the device.

Explanation:

Before a storage device can be used for data storage, it is required to prepare the device for use and to make the device to become visible to the operating system by formatting of the device

New storage devices are not pre-formatted or come with a ready to use file system as there are different file systems specifically designed for particular  operating systems or operating environment.

Formatting creates partitions, makes the hard drive visible to the operating system and creates a file system that is new such that the storage device can be used for storing files.

4 0
3 years ago
Other questions:
  • Mica's creating his web page with a software that is free of charge for the first month. If he likes the program, he will have t
    7·2 answers
  • A symbolic link is also known as a soft link and is depicted by an @ symbol appearing at the beginning of the filename when view
    7·1 answer
  • The convergence of information technology and operations technology, offering the potential for tremendous improvements in effic
    14·1 answer
  • How can you say that a computer is a versatile machine?​
    7·1 answer
  • Identify the equation that translates Y = In(x) five units down.​
    8·1 answer
  • Inputting a range of numbers comprising a batch and then inputting each serially numbered document is characteristic of the cont
    11·1 answer
  • PLS HURRY!!<br> Look at the image below
    7·1 answer
  • What are the two types of electronic components
    15·2 answers
  • How did transistors revolutionize the world of computers?
    15·1 answer
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!