Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

matlab problem

ScottDScottD Posts: 1Member
i have an assignment where we have to create a game. the user enters a certain launch angle of projectile and a desired speed. a graph has to then be plotted to show the path taken by the projectile.

i have written the code to do that and it works, i have included the ground level in the graph (y=50) and the target you must aim for.

however, the programme must consist of 5 levels. Each level has a differeent value of gravity ( 5 values of g found in the solar system). These levels or values of gravity have to be randomly generated and displayed in the command window.

I so far have a welcome message, then i ask the user to enter an angle and then velocity but it must show something like "level 1 - gravity is 9.81m/s^2)" and then "level 2 - gravity is xym/s^2". Can anyone tell me how to write the code to generate 5 levels which occur in random order as you progress through the game.

Thanks.

Comments

Sign In or Register to comment.