Joemath314159/any other programmer/mathematician, I need a little help...
Hey anyone so I have this assignment..
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.
Well I started off with this..
#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=;
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.
Now I can't find the gravity on the other planets.. anyone knows where I can find those?
It sounds like the problem refers to another example?
Thats a question for google! i'll see what i can find lol
I tried it gives me examples like gravity on mercury is 62% something gravity of earth.. anyway hold on ima post the assignment
yeah there are websites that give you age and mass (amongst other things)... that you can find on google - as joemath says, lol
Still want your owl? I have it...
#3 there.
that chart shows the ratio of the planets gravity to the earths.
lol estudier I have a nicer owl..oh god.. no easier ways?
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.
just multiply each one by 9.81 m/s^2 to get gravity
I thought the shades were critical:-)
yay lol
Anyway so am I on the right track? I'm going to attach what the professor wants from me basically
i will just be a cheerleader for this one because i'm dumb in this area. go computer science!
here
\[mg_{earth} = w\]\[mg_{mars} = m(.63g_{earth}) = .63mg_{earth} = .63w\]
run it and see what happens, i basically need to write my own version of that.
polpaks way is the best way. Unless you need the gravity of each planet for some reason.
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
This formula find you gravity anywhere \[6.67 10^{-11}\frac{\text{Mass}_{\text{planet}}}{\text{radius}_{\text{planet}}{}^2}\]
what joe just said is what i've given to you - the gravity on each planet and stuff
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.
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.
dont solve for them, just use the ratios (or percentages)
OK, so I want know how much a kilo is on Jupiter
no guys I'm trying to split the program into small pieces
by defining extra variables.. those variables are my gravities
oh, nvm then, gogo solve for gravity!
double g_Me=, g_Ve=, g_Mo=, g_Ma=, g_Ju=, g_Sa=, g_Ur=, g_Ne=;
lol yea.. i just have to find those, so then at the end it's not a mess
ill just solve for gravities.. thanks for all the help!
I still don't see why you need those
http://www.aerospaceweb.org/question/astronomy/q0227.shtml - has all the figures for gravity on all planets!!
you would just multiply 9.81 m/s^2 by those ratios right?
YESS I LOVE YA NAADIRAH!
LOL i posted it like 5 minutes ago!!
...or just look at Naadirahs link lol, awesome :)
google is a genius :)
That chart is flawed! Pluto isnt a planet! lolol jk jk
Is my age different on Jupiter?
you got me scared then. i thought i had it completely wrong:p
i dunno now i have to find the lengths of years on different planets.
Oh, I see, Jupiter years..
in hours.
a "year" is the time it takes for the planet to revolve once
yeah, figure out its orbit
My link should tell you
oh nice I can just do in days..
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)
i just made up those numbers (not my age)
good luck!!
You will have to use function for each planet
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
btw tnx for the pic estudier
u can only see my shades, not the owl haha
Join our real-time social learning platform and learn together with your friends!