Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Functions – Upset Fowls

Functions – Upset Fowls In this assignment, you’ll make a knock­off version of the Angry Birds game. The starter program is a working first draft of the game. 1. Correct the first FIXME by moving the intro text to a function named PrintIntro. Development suggestion: Verify the program has the same behavior before continuing. 2. Correct the second FIXME. Notice that the function GetUsrInpt will need to return two values: fowlAngle and fowlVel. 3. Correct the third FIXME. Notice that the function LaunchFowl only needs to return the value fowlLandingX, but needs the parameters fowlAngle and fowlVel. 4. Correct the fourth FIXME. Notice that the function DtrmnIfHit only needs to return the value didHitSwine, but needs the parameters fowlLandingX and swineX. The main should now look like the following code and the program should behave the same as the first draft: intmain(){ doublefowlAngle=0.0;//angleoflaunchoffowl(rad) doublefowlVel=0.0;//velocityoffowl(m/s) doubleswineX=0.0;//distancetoswine(m) doublefowlLandingX=0.0;//fowl’shoriz.dist.fromstart(m) booldidHitSwine=false;//didhittheswine? srand(time(0)); swineX=(rand()%201)+50; PrintIntro(); GetUsrInpt(swineX,fowlAngle,fowlVel); fowlLandingX=LaunchFowl(fowlAngle,fowlVel); didHitSwine=DtrmnIfHit(fowlLandingX,swineX); return0; } 5. Modify the program to continue playing the game until the swine is hit. Add a loop in main that contains the functions GetUsrInpt, LaunchFowl, and DtrmnIfHit. 6. Modify the program to give the user at most 4 tries to hit the swine. If the swine is hit, then stop the loop. Here is an example program execution (user input is highlighted here for clarity): WelcometoUpsetFowl! TheobjectiveistohittheMeanSwine. TheMeanSwineis84metersaway. Enterlaunchangle(deg):45 Enterlaunchvelocity(m/s):30 Time 1 x= 0 y= 0 Time 2 x= 21 y= 16 Time 3 x= 42 y= 23 Time 4 x= 64 y= 20 Time 5 x= 85 y= 6 Time 6 x=106 y=-16 Missed’em… TheMeanSwineis84metersaway. Enterlaunchangle(deg):45 Enterlaunchvelocity(m/s):25 Time 1 x= 0 y= 0 Time 2 x= 18 y= 13 Time 3 x= 35 y= 16 Time 4 x= 53 y= 9 Time 5 x= 71 y= -8 Hit’em!!!

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"