You are on yourwinter break, enjoying a relaxing skate at the local ice rink, wh
ID: 3608334 • Letter: Y
Question
You are on yourwinter break, enjoying a relaxing skate at the local ice rink, whenyou notice that your professor is "skating" next to the railingholding on for dear life. You look down to see that next toyou are a rotten tomato, a banana cream pie, and a largerock. Taking advantage of the opportunity, you pick up one ofthe items and throw it at your professor. Assuming you arestanding still on your skates when you throw the object and thatyou hit your professor directly in the head, what velocity will yoube traveling backwards after the throw?
A diagram of theproblem:
First we mustfigure out the velocity of the object in the horizontal directionof the professor. To make the problem easier the skater willalways throw the object at a 45? angle. Then the horizontalvelocity of the object will be:
To determine theresulting velocity of the skater in the opposite direction, we usethe Conservation of Momentum. That is, the (mass * velocity)of the object is equal the (mass * veocity) of the skater in theopposite direction. The resulting equation is:
Your task is to write a C program simulating the above problem. Usefunctions
Program inputs:
Program output:
Explanation / Answer
please rate - thanks as my message said this is correct except for gravity. when I plug the numbers into the formula by hand I get this answer.The only thing that I can see being wrong is the value of g #include #include #include #include #include void input(int *,int *,double*); double calculate(int,int,double); int main() {int lbs,meters; double kg,velskater; input(&lbs,&meters,&kg); velskater=calculate(lbs,meters,kg); printf(" Nice throw! RIP professor. Velocity of skater: %lfm/s ",velskater); getch(); return 0; } void input(int *lbs,int *meters,double*kg) {char object; int in; double in2; printf("How much do you weigh (pounds)? "); scanf("%d",&in); *lbs=in; printf("How far away is your professor (meters)? "); scanf("%d",&in); *meters=in; printf("Will you throw a rotten (t)omato, banana cream (p)ie,(r)ock, or (o)ther? "); object= getchar(); while (getchar() != ' '); printf("Enter the weight of the object in KG: "); scanf("%lf",&in2); *kg=in2; return; } double calculate(int lbs,int meters,double kg) {double g=9.8 ,gravity,velobj,velskater; velobj=sqrt((g*meters)/2.); velskater=kg*velobj/lbs; return velskater; }Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.