the acceleration of a sleigh sliding down a hill is a=g sin (a), where a is the slope of the hill and the gravity acceleration g=9.8 m/s2.
a) write a c++ function that calculates the acceleration as a function of the slope a in degrees.
b)write a c++ program that reads the slope and length of the hill as inputs,and calculates how long time it takes to slide down the hill.
1
Expert's answer
2012-07-17T09:14:17-0400
a) write a c++ function that calculates the acceleration as a function of the slope a in degrees.
double acc(double a){ return 9.8*sin(a); }
b)write a c++ program that reads the slope and length of the hill as inputs, and calculates how long time it takes to slide down the hill.
double time(double a, double l){ return sqrt(2*l/a); }
void main(){ cout<<"Enter the length of the hill (in meters): "; cin>>l; cout<<"Enter the slope of the hill (in degrees): "; cin>>a; cout<<"It takes "<<time(a, l)<< " seconds to slide down the hill.\r\n"; getch(); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Hi, at this moment I have not yet used your serve for my assignment or any assessment. I still wish to use your serve for my assessment to rate it on that. For the rating is base on the conduct you have deliver for paying my refund, I was doubting i will get it, thanks you were able to refund me.
Comments
Leave a comment