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
Trava [24]
3 years ago
12

Write a program that reads in the radius of a sphere and computes the surface area and volume of the sphere using the following

formulas: A = 4*3.14r 2 V = 4/3 x 3.14r 3
Enter the radius of the sphere: 2.5 [Enter]

The surface area of the sphere is 78.53982

The volume of the sphere is 65.44985
Computers and Technology
1 answer:
Oksana_A [137]3 years ago
6 0

Answer:

// program in Python.

#library

import math

#read the radius of sphere

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

# find the Surface area

A=4*math.pi*rad**2

V=(4/3)*math.pi*rad**3

#print the Surface area

print("The surface area of the sphere is:",A)

#print the Volume of sphere

print("The volume of the sphere is:",V)

Explanation:

Import math library to use the value of "pi".Read the radius of sphere from user  and assign it to variable "rad".Then calculate the surface area A = 4*3.14r**2  and volume of sphere V=V = 4/3 x 3.14r**3.Print the surface area and volume of  the sphere.

Output:

Enter the radius of sphere:2.5                                                                                            

Surface area is: 78.539812                                                                                  

Volume of sphere is: 65.44985

You might be interested in
What is the first step necessary to begin setting up a website once a host has been selected and paid?
NemiM [27]

Answer: Select a domain name

4 0
3 years ago
Which are the two alternatives for pasting copied data in a target cell or a group of cells ?
dlinn [17]
First, you click and drag the letters/images you wanna copy, you do Ctrl + C then you clikc another cell until you get the flashing line, do Ctrl + V and there you go
4 0
4 years ago
Read 2 more answers
I NEED HELP ASAP!!!!!! IM IN THE MIDDLE OF A QUIZ!!!! Why did the film industry agree to set standards for film production?
Pani-rosa [81]

Answer:

My guess is "It was cheaper to follow standards than having to guess what audiences wanted."

Explanation:

Not 100% but I tRiEd

5 0
3 years ago
def getCharacterForward(char, key): """ Given a character char, and an integer key, the function shifts char forward `key` steps
zhenek [66]

Answer:

  1. def getCharacterForward(char, key):  
  2.    charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3.    if(len(char) > 1):
  4.        return None  
  5.    elif(not isinstance(key, int)):
  6.        return -1
  7.    else:
  8.        index = charList.find(char)
  9.        if(index + key <= 25):
  10.            return charList[index + key]
  11.        else:
  12.            return charList[(index + key)% 26]
  13. print(getCharacterForward("C", 4))
  14. print(getCharacterForward("X", 4))

Explanation:

Firstly, define a charList that includes all uppercase alphabets (Line 2). We presume this program will only handle uppercase characters.

Follow the question requirement and define necessary input validation such as checking if the char is a single character (Line 4). We can do the validation by checking if the length of the char is more than 1, if so, this is not a single character and should return None (Line 5). Next, validate the key by using isinstance function to see if this is an integer. If this is not an integer return -1 (Line 6 - 7).

Otherwise, the program will proceed to find the index of char in the charList using find method (Line 9). Next, we can add the key to index and use the result value to get forwarded character from the charList and return it as output (Line 11).

However, we need to deal a situation that the char is found at close end of the charList and the forward key steps will be out of range of alphabet list. For example the char is X and the key is 4, the four steps forward will result in out of range error. To handle this situation, we can move the last two forward steps from the starting point of the charList. So X move forward 4 will become B. We can implement this logic by having index + key modulus by 26 (Line 13).  

We can test the function will passing two sample set of arguments (Line 15 - 16) and we shall get the output as follows:

G

B

8 0
3 years ago
Which of the following is NOT true about adjustment layers? brainbuffet
otez555 [7]

Answer the adjustment layers can not be used a lot?

Explanation: i think that was it

6 0
3 years ago
Other questions:
  • Your friends know that you understand a lot about computers, both the technical details of how they operate as well as informati
    12·1 answer
  • If needed, you can pull over on the shoulder of the freeway to take a break if you are tired. true or false (drivers ed) need as
    11·1 answer
  • What is the printout for the first statement in the main method?
    13·1 answer
  • Write a program that displays a menu allowing the user to select air water, or steel. After the user has made a selection, the n
    10·1 answer
  • A cable that connects the computer to the printer is an example of<br> A.hardware<br> B.software
    13·2 answers
  • What two benefits are a result of configuring a wireless mesh network? Check all that apply.
    12·1 answer
  • How many characters should a strong password have? four six eight ten
    10·2 answers
  • 7.3.4: Find the Error
    7·1 answer
  • Intelligent transportation systems use GPS to<br> Select all that apply.
    5·1 answer
  • Information technology student Roberta has been assigned a project on how to detect unwanted outgoing attacks. Which step is par
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!