By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Homework problem with satellite program

P: 16
I need to make a program where:

In this program you MUST use the following functions and header file (library function):
#include<cmath >

You run a company that ships satellite dishes to customers. The satellite dish is ordered based on the area of its opening (in square inches):

You need to calculate how much cardboard (in square inches) and how much Styrofoam peanut packing (in cubic inches) you will need.

The box will be a perfect cube just large enough to hold the satellite dish

The Styrofoam peanuts are inexpensive, so we will just calculate the amount needed to fill the box completely, and not worry about the peanuts that will overflow due to the volume of the dish. In your calculations use PI = 3.141592654.

The output should look like this:

How big is the satellite dish (in square inches)? 75
You need 572.958 square inches of cardboard.
You need 933.162 cubic inches of Styrofoam peanuts.

In your program code you need to check whether or not the number the user entered is negative. If it is negative your output should look like the following:

How big is the satellite dish (in square inches)? -100
Your answer is negative, converting to the absolute value.
You need 763.944 square inches of cardboard.
You need 1436.7 cubic inches of Styrofoam peanuts.

Can anybody help me? I tried doing it but it wasnt working (and my program got deleted...)
Nov 1 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.