codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Homework problem  jwmonroe at 17:04 on Friday, June 23, 2006
 

Ok here is the problem...Write a C++ program that allows users to enter the percentage of the moons face that appears illuminated, and that outputss the surface area of that portion of the moon. The formula for the surface area of a segment of a sphere is

S= 2 * (radius * radius) * angle of wedge in radians

There are two radians in a circle, so the hemisphere of the moon that we see accounts for at most 3.1415927 radians. Thus if the user enters 100% (full moon) the angle of wedge is 3.1415927=

S= 2 * (1738.3 * 1738.3) * 3.1415927= 18985818.672 square kilometers

If the user enters 50%(first or first quarter) then the angle of the wedge is 3.415927 * 0.5 and so on. Be sure to use proper formating and appropriate comments in your code. Provide appropriate prompts to the user. The output should be labeled clearly and formatted neatly ( limit the decimal precision to three places as in the example above.

Please help me.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: problem with Exception
•  Re: Turning java class into application
•  Re: this is weird
•  Server Name or Address could not be resolved?
•  Re: How can I read ASCII data file in C++
•  Sending automated emails
•  Re: How to kill framesets
•  What is This?
•  onKeyPress - calling a javascript function , which is showing error.


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006