Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

csci 251. Please answer in MatLab format Programming Assignment 1 CSCI 251 - Spring 2018 Introduction The Ole Miss Engineering Department holds a trebuchet competition

csci 251. Please answer in MatLab format
image text in transcribed
image text in transcribed
image text in transcribed
Programming Assignment 1 CSCI 251 - Spring 2018 Introduction The Ole Miss Engineering Department holds a trebuchet competition each year for middle and high school teams to compete. For this assignment, we'll be evaluating some of the trebuchet's performances in the Accuracy category Once a trebuchet launches its projectile, three parameters determine whether the projectile wil hit the target the initial speed and initial angle the projectleis launched at, and the distance to the target. For simplicity's sake, we will be ignoring the effects of air resistance, as well as any height differences between the location and the target. Therefore, the total time of fight for the projectile can be given by the following equation: Speed esit le) Where is the acceleration of gravity 9.81 mi? While toward the target in a horizontal distance given by the projectile travels range flight Time mit Speed (mit Angle) For this assignment, prompt the user for the initial distance to the target im. then speed and the initial flight angle (degrees) using the input function that we talked about in class. Then, using the above equations, calculate the flight time and distance the projectile travels Print the inputs back to the user using print. Also, output the flight time, the range the projectile travels, and whether the shot was a miss or a hit, assuming the projectile lands without rolling and is aimed correctly, so that the projectile will hit the target travels the correct distance and does not overshoot Assume a target diameter of 5 meters and therefore a radius of 2.5 meters) Input initial distance from which the projectile is shot, in meters initial flight angle, in degrees initial speed, in meters/second Outour distance, angle and speed, to 2 decimal places calculated flight time and range, to 2 decimal places whether or not the shot miss or hit Considerations 1. Name your program trebuchet Include header comments at the beginning of your m-file formatted as shown below. Be sure to include the Honor Code statement and program description. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement SCSCI 251. Section 12345678 Programming Assignment1 Due In keeping with the Honor Code of the School of Engineering I have neither given nor received assistance from anyone other than the instructor Puta program description here 2. When defining the acceleration of gravity, use the variable name GRAVITY to of 3 Considerations 1. Name your program trebuchet.m. Include header comments at the beginning of your m-file) formatted as shown below. Be sure to include the Honor Code statement and program description. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement. % CSCI 251, Section X % Jane Doe % Student ID 12345678 % Programming Assignment 1 % Due % In keeping with the Honor Code of the School of Engineering % I have neither given nor received assistance from anyone other than the instructor % Put a program description here 2. When defining the acceleration of gravity, use the variable name GRAVITY to define this constant. Note that all-caps are used since this is the naming convention for constants. 3. Matlab has both sin and cos functions. Since x is in degrees for this programming assignment, use sind(x) and cos(x). If x had been in radians, you would have used sin(x) and cos(x) 4. We have not learned how to output "true" or "false" in regard to a shot being a miss or hit, so use the comparison operator (.e.,

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions