A projectile is launched at an angle theta, e, to the horizontal with an initial velocity (v, ). It rises upwards to a maximum height while moving horizontally with a velocity (v, ). Write a ČSharp...


A projectile is launched at an angle theta, e, to the horizontal with an initial velocity (v, ). It rises<br>upwards to a maximum height while moving horizontally with a velocity (v, ). Write a ČSharp<br>program that prompts for and reads the initial velocity (v, ) in m/s and the angle theta in<br>degrees. Based on this input, the program computes and displays the maximum height, in meters,<br>reached by the projectile and the time taken to reach this height.<br>Note that the maximum height is reached when the vertical velocity (v, ) is 0o. The equations of<br>the height and vertical velocity are given below:<br>height = vo sin(0)t – 0.5gt?<br>V, = vo sin(0) – gt<br>Where:<br>g is the gravity acceleration to be defined as a constant with a value of 9.8 m/s?<br>180 degrees = n radians<br>n is to be defined as a constant with a value of 3.14159<br>max height<br>

Extracted text: A projectile is launched at an angle theta, e, to the horizontal with an initial velocity (v, ). It rises upwards to a maximum height while moving horizontally with a velocity (v, ). Write a ČSharp program that prompts for and reads the initial velocity (v, ) in m/s and the angle theta in degrees. Based on this input, the program computes and displays the maximum height, in meters, reached by the projectile and the time taken to reach this height. Note that the maximum height is reached when the vertical velocity (v, ) is 0o. The equations of the height and vertical velocity are given below: height = vo sin(0)t – 0.5gt? V, = vo sin(0) – gt Where: g is the gravity acceleration to be defined as a constant with a value of 9.8 m/s? 180 degrees = n radians n is to be defined as a constant with a value of 3.14159 max height
To solve this problem, your program must contain, in addition to the main function, 3 other<br>functions:<br>• degToRad function that recelves the angle in degrees and returns it in radians.<br>• getTimeToPeak function that receives the initial velocity and the angle theta in radians and it<br>returns the time to reach the maximum height in seconds.<br>• getMaxHeight function that receives the initial velocity , the angle theta in radlans, and the<br>time to reach maximum height in seconds and returns the maximum height in meters.<br>The range of the valid input is:<br>0s 0 < 90 degrees<br>Vo 2 0<br>If the input is not valid, your program displays

Extracted text: To solve this problem, your program must contain, in addition to the main function, 3 other functions: • degToRad function that recelves the angle in degrees and returns it in radians. • getTimeToPeak function that receives the initial velocity and the angle theta in radians and it returns the time to reach the maximum height in seconds. • getMaxHeight function that receives the initial velocity , the angle theta in radlans, and the time to reach maximum height in seconds and returns the maximum height in meters. The range of the valid input is: 0s 0 < 90 degrees vo 2 0 if the input is not valid, your program displays "error: wrong input" message and terminates. note: • you must put the definition of the main function before those of degtorad, gettimetopeak, and getmaxheight. • the functions degtorad, gettimetopeak, and getmaxheight must not contain any printf or scanf calls. all reading and printing must be done in the main function. sample program runs: vo in /s: 25.6 enter theta in degrees: 85.3 time to reach max height-2.60 secs maximum height - 33.21 enter vo in m/s:-34.5 enter theta in degrees: 40.5 error: wrong input enter vo in m/s: 30.8 enter theta in degrees: 120.6 error: wrong input 90="" degrees="" vo="" 2="" 0="" if="" the="" input="" is="" not="" valid,="" your="" program="" displays="" "error:="" wrong="" input"="" message="" and="" terminates.="" note:="" •="" you="" must="" put="" the="" definition="" of="" the="" main="" function="" before="" those="" of="" degtorad,="" gettimetopeak,="" and="" getmaxheight.="" •="" the="" functions="" degtorad,="" gettimetopeak,="" and="" getmaxheight="" must="" not="" contain="" any="" printf="" or="" scanf="" calls.="" all="" reading="" and="" printing="" must="" be="" done="" in="" the="" main="" function.="" sample="" program="" runs:="" vo="" in="" s:="" 25.6="" enter="" theta="" in="" degrees:="" 85.3="" time="" to="" reach="" max="" height-2.60="" secs="" maximum="" height="" -="" 33.21="" enter="" vo="" in="" m/s:-34.5="" enter="" theta="" in="" degrees:="" 40.5="" error:="" wrong="" input="" enter="" vo="" in="" m/s:="" 30.8="" enter="" theta="" in="" degrees:="" 120.6="" error:="" wrong="">
Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here