首页 新闻 聚焦 科技 财经 创业 综合 图片 视频

IT界

旗下栏目: 行业 生态 IT界 创新

MNTC 313讲解、辅导C/C++程序语言

来源:互联网 发布时间:2021-06-02
MNTC 313讲解、辅导C/C++程序语言
MNTC 313 – Assignment 3
1 of 2
A common situation dealt With in engineering and physics is that of projectile motion. The
equation for the height of a projectile, 𝑦 [m], is:
𝑔 = Acceleration due to gravity: 9.81 m/s2
𝑡 = Time (seconds)
𝑉0 = Initial Velocity of Projectile (m/s)
Ѳ0 = Launch Angle (degrees)
𝑦0= Initial height of the projectile (m)
The equation for the vertical velocity of the projectile, 𝑥 [m], is:
𝑉𝑦 = −𝑔𝑡 + 𝑉0 sin(Ѳ0
).
Write a program using C/C++ to determine the projectile motion (height, vertical velocity) at a
certain time. 
MNTC 313 – Assignment 3
2 of 2
Your code should then employ the following logical conditions:
• If time is greater or equal than zero, first print “Projectile released”
o Print the position and velocity value with the following format:
“Position: xx.xx meters”
“Velocity value: xx.xx meters/second”
o If the projectile has a Vertical velocity greater or equal than zero, print “Projectile
ascending”
▪ If the vertical position of the Projectile is greater or equal than the initial
vertical position, print “Projectile above initial position”
o Or, if the projectile has a negative vertical velocity, print “Projectile descending”
▪ If the vertical position of the projectile is greater or equal than the initial
vertical position, print “Projectile above initial position”
▪ Otherwise, print “Projectile below initial position”
• Or, if time is lower than zero, print “Projectile not released”
Your output must look like:
10,10,45,10
Projectile released
Position: -409.82 meters
Velocity value: -91.03 meters/second
Projectile descending
Projectile below initial position
And for negative time must look like:
-10,10,45,10
Projectile not released
Note: The first line in each example above contains sample inputs passed via the scanf()
statement. Your program should Function properly for any inputs. A starter code file has been
provided on OnQ. Download the file, and copy and paste its contents into a new .c/.cpp file in
your IDE. Use pi = 3.14.
Reminder: Please DO NOT include any personal information such as name, student number or
Net ID in your submission. All submissions to Gradescope will be run through plagiarism
detection software.
请加QQ:99515681 或邮箱:99515681@qq.com   WX:codehelp
  免责声明:珠穆朗玛网对于有关本网站的任何内容、信息或广告,不声明或保证其正确性或可靠性,用户自行承担使用网站信息发布内容的真假风险。
责任编辑:珠穆朗玛网