Question: must be in matlab format 10:197 Search .. LED x signment 1 F15 - Trebuchets.p ... 1 of 3 Programming Assignment 1 CSCI 251 -




10:197 Search .. LED x signment 1 F15 - Trebuchets.p ... 1 of 3 Programming Assignment 1 CSCI 251 - Spring 2018 The Ole Miss Engineering Department holds a buchet comitio each year for middle and high school teams to compete. For this assignment we be t ing some of the trebuches performances in the Accuracy tegory Once a trebuchet launches its pr e param e whether the project will be the target the speed and initial angle the proces launched and the distance to the target For Simplicity we will be on the afect of non, as well as any differences the location and the target. Therefore, the total time of fight for the projectile can be given by the following 2 Where is the ac tion of gravity -9.81 toward the target in a horizontal distance given by Whe ther travels For this assignment, prompt the user for the w weeds and the infight angle degree about indiass. Then using the above the projectile travels e ather the initial in the coated all the s e and distance Print the inputs back to the user using print. Als out the m the range the projectile travels, and whether the shot was a missora assuming the projecte lands without rolling and same comes that the proc h e target travels the corect distance and does not overshoot Asume aanget diameter of 5 meters and therefore a radius of ZS meters who meters inical distance from which the projects initial fight angle in degrees initial speed, in meters second Dutert distance angle and speed, to 2 decimal places calculated fight me and range, 2 decimal places whether or not the shot miss or het 1. Name you agam the include de comm e 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 Sement 2. When defining the acceleration of gravity use the war define this constant. Note that a re used convention for constants. e GRAVITY this is the naming 3. Mataasboll programming assignment, use sind and cost had been indians you 10:19 Search .. LED X Programming Assignment...... 2 of 3 Conserton 1. Name your program trebuchem Indude header comes the beginning of your m-file formated as shown below. Be sure to include the Honor Code statement and program description. Your electronic s of the program le will represent your endorsement of the Honor Code 2. When defining the acceleration of gravity use the define this constant that we d convention for constant GRAVITY the main o this Matlab has both in and cos functions. Sincerisinde for this programming assignment, sind and cost had been in adian you would have used in and Co 4. We have not med how to outputori d ash benga mis or hits use the comparison operator , 25 o tthet Note that you should be comparing 25 against the ofte difference of the dance to the large and then the role Tund Prompt type hep aboo momebout how this 5. Before each significant step, provide a comment the door Same Our Note Bold and undefined values in from the keyboard Enter the initial distance to the target 55.5 Enter the initial spoed when the project is launched 325 Enter the initialight angle in degree: 15 Initial distance to target (m): 6550 Initial speedimisk 3250 Initialight angle (degrees 18.00 Flight time is 2.0 t o the target 655 Enter the in Enter the 10:19 Search LTE O X Programming Assignment... mis or hits the common operator 25 t h Note that you should be comparing 2 a t the two ce of the distance to the target and the other 3 of 3 in Command Prompt.type h as to more about how to use this 5. Before each significant provide a comment i ng these do not comment every line of code Sample Output Note Bold and underned e red in from the board Enter the initial distance to the target 6.5 Enter the speed when the projectes launched 325 Enter the angle in degrees Initiali ceto target (m): 65.50 Initialight angle (degrees 18.00 Flight time 2.05 Range: 29 0 - Miss Enter the incidance to the target 655 Enter the initial speed when the procesundhed: 315 Enter the initiation angle in degrees Initial distance to target (m): 65.50 Initial speedmi 3150 Initialight angle degrees 18.00 Flight time is 1.50 Range: 59.45 Miss! 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 Speedesinit ) Where is the acceleration of gravity 9.81 mi While toward the target in a horizontal distance given by the projectile travel range flight Time mit Speed contAngle) 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 CSCI 251, Section X Dor SS 12345678 Programming Assignment Due In keeping with the Honor Code of the School of Engineering I have nother 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 2 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 Thave 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 (ie, ca 2.5) to output the result. Note that you should be comparing 2.5 against the absolute value of the difference of the initial distance to the target and the distance the projectile travels (in Command Prompt, type help abs to learn more about how to use this function) 5. Before each significant step, provide a comment explaining the step (do not comment every line of code). Sample Output Note: Bold and underlined are values entered in from the keyboard Enter the initial distance to the target: 65.5 Enter the initial speed when the projectile is launched: 32.5 Enter the initial flight angle in degrees: 18 Initial distance to target (m): 65.50 Initial speed (m/s): 32.50 Initial flight angle (degrees): 18.00 Flight time (s): 2.05 Range: 63.29 0 = Miss! 1=Hit! Enter the initial distance to the target: 65.5 Enter the initial speed when the projectile is launched: 31.5 Enter the initial flight angle in degrees: 18 Initial distance to target (m): 65.50 Initial speed (m/s): 31.50 Initial flight angle (degrees): 18.00 Flight time (s): 1.98 Range: 59.45 0 = Miss! 1=Hit! 10:197 Search .. LED x signment 1 F15 - Trebuchets.p ... 1 of 3 Programming Assignment 1 CSCI 251 - Spring 2018 The Ole Miss Engineering Department holds a buchet comitio each year for middle and high school teams to compete. For this assignment we be t ing some of the trebuches performances in the Accuracy tegory Once a trebuchet launches its pr e param e whether the project will be the target the speed and initial angle the proces launched and the distance to the target For Simplicity we will be on the afect of non, as well as any differences the location and the target. Therefore, the total time of fight for the projectile can be given by the following 2 Where is the ac tion of gravity -9.81 toward the target in a horizontal distance given by Whe ther travels For this assignment, prompt the user for the w weeds and the infight angle degree about indiass. Then using the above the projectile travels e ather the initial in the coated all the s e and distance Print the inputs back to the user using print. Als out the m the range the projectile travels, and whether the shot was a missora assuming the projecte lands without rolling and same comes that the proc h e target travels the corect distance and does not overshoot Asume aanget diameter of 5 meters and therefore a radius of ZS meters who meters inical distance from which the projects initial fight angle in degrees initial speed, in meters second Dutert distance angle and speed, to 2 decimal places calculated fight me and range, 2 decimal places whether or not the shot miss or het 1. Name you agam the include de comm e 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 Sement 2. When defining the acceleration of gravity use the war define this constant. Note that a re used convention for constants. e GRAVITY this is the naming 3. Mataasboll programming assignment, use sind and cost had been indians you 10:19 Search .. LED X Programming Assignment...... 2 of 3 Conserton 1. Name your program trebuchem Indude header comes the beginning of your m-file formated as shown below. Be sure to include the Honor Code statement and program description. Your electronic s of the program le will represent your endorsement of the Honor Code 2. When defining the acceleration of gravity use the define this constant that we d convention for constant GRAVITY the main o this Matlab has both in and cos functions. Sincerisinde for this programming assignment, sind and cost had been in adian you would have used in and Co 4. We have not med how to outputori d ash benga mis or hits use the comparison operator , 25 o tthet Note that you should be comparing 25 against the ofte difference of the dance to the large and then the role Tund Prompt type hep aboo momebout how this 5. Before each significant step, provide a comment the door Same Our Note Bold and undefined values in from the keyboard Enter the initial distance to the target 55.5 Enter the initial spoed when the project is launched 325 Enter the initialight angle in degree: 15 Initial distance to target (m): 6550 Initial speedimisk 3250 Initialight angle (degrees 18.00 Flight time is 2.0 t o the target 655 Enter the in Enter the 10:19 Search LTE O X Programming Assignment... mis or hits the common operator 25 t h Note that you should be comparing 2 a t the two ce of the distance to the target and the other 3 of 3 in Command Prompt.type h as to more about how to use this 5. Before each significant provide a comment i ng these do not comment every line of code Sample Output Note Bold and underned e red in from the board Enter the initial distance to the target 6.5 Enter the speed when the projectes launched 325 Enter the angle in degrees Initiali ceto target (m): 65.50 Initialight angle (degrees 18.00 Flight time 2.05 Range: 29 0 - Miss Enter the incidance to the target 655 Enter the initial speed when the procesundhed: 315 Enter the initiation angle in degrees Initial distance to target (m): 65.50 Initial speedmi 3150 Initialight angle degrees 18.00 Flight time is 1.50 Range: 59.45 Miss! 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 Speedesinit ) Where is the acceleration of gravity 9.81 mi While toward the target in a horizontal distance given by the projectile travel range flight Time mit Speed contAngle) 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 CSCI 251, Section X Dor SS 12345678 Programming Assignment Due In keeping with the Honor Code of the School of Engineering I have nother 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 2 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 Thave 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 (ie, ca 2.5) to output the result. Note that you should be comparing 2.5 against the absolute value of the difference of the initial distance to the target and the distance the projectile travels (in Command Prompt, type help abs to learn more about how to use this function) 5. Before each significant step, provide a comment explaining the step (do not comment every line of code). Sample Output Note: Bold and underlined are values entered in from the keyboard Enter the initial distance to the target: 65.5 Enter the initial speed when the projectile is launched: 32.5 Enter the initial flight angle in degrees: 18 Initial distance to target (m): 65.50 Initial speed (m/s): 32.50 Initial flight angle (degrees): 18.00 Flight time (s): 2.05 Range: 63.29 0 = Miss! 1=Hit! Enter the initial distance to the target: 65.5 Enter the initial speed when the projectile is launched: 31.5 Enter the initial flight angle in degrees: 18 Initial distance to target (m): 65.50 Initial speed (m/s): 31.50 Initial flight angle (degrees): 18.00 Flight time (s): 1.98 Range: 59.45 0 = Miss! 1=Hit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
