Ask your own question, for FREE!
Mathematics 16 Online
OpenStudy (bahrom7893):

Joemath314159/any other programmer/mathematician, I need a little help...

OpenStudy (bahrom7893):

Hey anyone so I have this assignment..

OpenStudy (bahrom7893):

Write a program whose input will be your weight (in lbs) and age (inyears) and whose output will be a table containing your weight and age on the other planets in our solar system and our moon. You can figure out the appropriate conversions using the example below. Your answers shouldbe correct to 2 decimal places. Your output should look very similar to the example below, but you can decide on the exact wording. You can decide how you want the user to input these values, but it should be clear and properly explained.

OpenStudy (bahrom7893):

Well I started off with this..

OpenStudy (bahrom7893):

#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main() { double w, m, a_yrs, a; cout << "Please enter your weight (lbs):\n"; cin >> w; double m=w/9.8; cout << "Please enter your age (years):\n"; cin >> a_yrs; double a=a_yrs*8760; double g_Me=, g_Ve=, g_Mo=, g_Ma=, g_Ju=, g_Sa=, g_Ur=, g_Ne=;

OpenStudy (bahrom7893):

Now see that's what I'm doing like first the person will enter their weight, it will be converted to mass, and then reconverted to mass on another planet.

OpenStudy (bahrom7893):

Now I can't find the gravity on the other planets.. anyone knows where I can find those?

OpenStudy (shadowfiend):

It sounds like the problem refers to another example?

OpenStudy (anonymous):

Thats a question for google! i'll see what i can find lol

OpenStudy (bahrom7893):

I tried it gives me examples like gravity on mercury is 62% something gravity of earth.. anyway hold on ima post the assignment

OpenStudy (anonymous):

yeah there are websites that give you age and mass (amongst other things)... that you can find on google - as joemath says, lol

OpenStudy (anonymous):

Still want your owl? I have it...

OpenStudy (bahrom7893):

#3 there.

OpenStudy (anonymous):

that chart shows the ratio of the planets gravity to the earths.

OpenStudy (bahrom7893):

lol estudier I have a nicer owl..oh god.. no easier ways?

OpenStudy (anonymous):

Ok well if gravity on mars is 63% of earth and they give you weight on earth your weight on mars will be 63% of that.

OpenStudy (anonymous):

just multiply each one by 9.81 m/s^2 to get gravity

OpenStudy (anonymous):

I thought the shades were critical:-)

OpenStudy (anonymous):

OpenStudy (bahrom7893):

yay lol

OpenStudy (bahrom7893):

Anyway so am I on the right track? I'm going to attach what the professor wants from me basically

myininaya (myininaya):

i will just be a cheerleader for this one because i'm dumb in this area. go computer science!

OpenStudy (bahrom7893):

here

OpenStudy (anonymous):

\[mg_{earth} = w\]\[mg_{mars} = m(.63g_{earth}) = .63mg_{earth} = .63w\]

OpenStudy (bahrom7893):

run it and see what happens, i basically need to write my own version of that.

OpenStudy (anonymous):

polpaks way is the best way. Unless you need the gravity of each planet for some reason.

OpenStudy (anonymous):

scroll down a little on this web page and i think you might find something that helps you :) http://www.aerospaceweb.org/question/astronomy/q0227.shtml

OpenStudy (anonymous):

This formula find you gravity anywhere \[6.67 10^{-11}\frac{\text{Mass}_{\text{planet}}}{\text{radius}_{\text{planet}}{}^2}\]

OpenStudy (anonymous):

what joe just said is what i've given to you - the gravity on each planet and stuff

OpenStudy (bahrom7893):

lol thanks for all the help guys. I thought I wouldn't have to solve for each of the gravities.. but seems I'll have to.

OpenStudy (anonymous):

If they give you the gravity on each planet as a % of earth's gravity, then the weight on that planet will be that same percentage of your weight on earth.

OpenStudy (anonymous):

dont solve for them, just use the ratios (or percentages)

OpenStudy (anonymous):

OK, so I want know how much a kilo is on Jupiter

OpenStudy (bahrom7893):

no guys I'm trying to split the program into small pieces

OpenStudy (bahrom7893):

by defining extra variables.. those variables are my gravities

OpenStudy (anonymous):

oh, nvm then, gogo solve for gravity!

OpenStudy (bahrom7893):

double g_Me=, g_Ve=, g_Mo=, g_Ma=, g_Ju=, g_Sa=, g_Ur=, g_Ne=;

OpenStudy (bahrom7893):

lol yea.. i just have to find those, so then at the end it's not a mess

OpenStudy (bahrom7893):

ill just solve for gravities.. thanks for all the help!

OpenStudy (anonymous):

I still don't see why you need those

OpenStudy (anonymous):

http://www.aerospaceweb.org/question/astronomy/q0227.shtml - has all the figures for gravity on all planets!!

OpenStudy (anonymous):

you would just multiply 9.81 m/s^2 by those ratios right?

OpenStudy (bahrom7893):

YESS I LOVE YA NAADIRAH!

OpenStudy (anonymous):

LOL i posted it like 5 minutes ago!!

OpenStudy (anonymous):

...or just look at Naadirahs link lol, awesome :)

OpenStudy (anonymous):

google is a genius :)

OpenStudy (anonymous):

That chart is flawed! Pluto isnt a planet! lolol jk jk

OpenStudy (anonymous):

Is my age different on Jupiter?

OpenStudy (anonymous):

you got me scared then. i thought i had it completely wrong:p

OpenStudy (bahrom7893):

i dunno now i have to find the lengths of years on different planets.

OpenStudy (anonymous):

Oh, I see, Jupiter years..

OpenStudy (bahrom7893):

in hours.

OpenStudy (anonymous):

a "year" is the time it takes for the planet to revolve once

OpenStudy (anonymous):

yeah, figure out its orbit

OpenStudy (anonymous):

My link should tell you

OpenStudy (bahrom7893):

oh nice I can just do in days..

OpenStudy (anonymous):

so if you create ratios of revolutions, that should do the trick. Something like, Jupiter spins .67 times when the earth spins once. Then my age on jupiter would be 25(.67) (im 25yrs old)

OpenStudy (anonymous):

i just made up those numbers (not my age)

OpenStudy (anonymous):

good luck!!

OpenStudy (anonymous):

You will have to use function for each planet

OpenStudy (bahrom7893):

ty all. Ima post my first weight/year converter here once I'm done. I already have a basic quadratic solver and a y=mx+b equation finder written up

OpenStudy (bahrom7893):

btw tnx for the pic estudier

OpenStudy (bahrom7893):

u can only see my shades, not the owl haha

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!