# calculate the volume and surface area of a sphere from its radius

Page 1 of 1

## 3 Replies - 11889 Views - Last Post: 24 August 2009 - 04:00 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=121288&amp;s=ae8f5a6639b267148593e46f7161dcbf&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 jugaad

• New D.I.C Head

Reputation: 1
• Posts: 1
• Joined: 20-August 09

# calculate the volume and surface area of a sphere from its radius

Posted 20 August 2009 - 03:30 AM

I am just looking a help from python experts:

program to calculate the volume and surface area of a sphere from its radius, given as input. Use the following formulas for reference. Limit your numbers to 4 decimal places using string formatting

1. Numerologists claim to be able to determine a person’s character traits based on the “numeric value” of a name. The value of a name is determined by summing up the values of the letters of a name where “a” is 1, “b” is 2 and so on. Write a program that calculates the numeric value of a single name provided as input.

2. Using the file giftFile.txt supplied, write a program that takes each line of the file and writes a thank you note to the giver of the gift. For example, the first letter would read:

Dear Fred,

Thank you for the wonderful sheets.
What a thoughtful wedding gift.

Love
<put your name here>

The thank you letter should be one string and the variables (ie the name, gift and occasion) should be put in using string formatting techniques

3. Ballarat Beans is a mail-order coffee shop which sells coffee for \$23 a kilogram plus the cost of shipping. Each order is shipped for \$1.20 per kilogram (rounded up to the nearest kilogram). Write a program to calculate the cost of an order. Use string formatting to limit the figures in your output to 2 decimal places.

Is This A Good Question/Topic? 1

## Replies To: calculate the volume and surface area of a sphere from its radius

### #2 girasquid

• Barbarbar

Reputation: 108
• Posts: 1,825
• Joined: 03-October 06

## Re: calculate the volume and surface area of a sphere from its radius

Posted 20 August 2009 - 07:26 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this:

Thanks.
Was This Post Helpful? 0

### #3 code_m

• D.I.C Head

Reputation: 24
• Posts: 202
• Joined: 21-April 09

## Re: calculate the volume and surface area of a sphere from its radius

Posted 20 August 2009 - 01:11 PM

pydoc is your friend!
Was This Post Helpful? 0

### #4 Notorion

• D.I.C Regular

Reputation: 35
• Posts: 378
• Joined: 17-February 09

## Re: calculate the volume and surface area of a sphere from its radius

Posted 24 August 2009 - 04:00 PM

we won't do the work for you. Please supply a specific question (or multiple questions) and we can help you from there. Are you asking what is the volume and surface area formula of a sphere?
Was This Post Helpful? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }