LAB Topic 2 team F23

docx

School

Texas A&M University *

*We aren’t endorsed by this school

Course

102

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

3

Uploaded by ProfLightning103643

Report
Lab: Topic 2 (team) ENGR 102 – Fall 2023 Lab: Topic 2 (team) Deliverables. This lab consists of three team activities. Please submit the following files to Canvas and zyBooks. sequential_algorithm.pdf to Canvas giving_instructions.pdf to Canvas linear_interpolation.py to zyBooks Create the file for Activities #1 and #2 using a word processing program such as Word or Google Docs, then save that in PDF format for submission . Please put the names of all team members that contributed at the top of each document. For Activity #3, be sure to include the team version of the header information at the top of your code. Activity #1 : Sequential Algorithm – team This activity is meant to help illustrate the process of breaking more complex processes into sequential steps, and some of the choices and assumptions involved in doing so. 1) To begin, each member of your team should individually create a sequence of instructions for a person to get from your classroom in Bldg. 900 to the San Antonio airport terminal B at the American Airlines ticket counter. Write your instructions as precisely as possible; It might help you to bring up a map of campus San Antonio and the airport. 2) Next, as a team, you should look at each member’s instructions one-by-one. Comment on each set of instructions, specifically noting whether the instructions are clear, whether they provide sufficient detail, and whether they would get someone to the destination. The person who wrote the instructions should not comment on their own instructions. BEFORE MOVING ON: Discuss as a team: Which one of the sets of instructions do you consider the “best”? Why? 3) DO NOT READ UNTIL TASK 2 IS COMPLETE! As a team: Discuss together and answer the following questions. Your team should produce a single PDF document named sequential_algorithm.pdf with two items: (1) copies of each of the sets of instructions (you will need to share, e.g. by Google Drive, your instructions with each other), and (2) brief (a couple of sentences, or lists of no more than 10 things) answers to the following questions: a. Which set of your team’s sequences of steps did you identify as being the best? Why? b. In what ways were the sets of sequences that were produced different? c. In what ways were the sets of sequences that were produced the same? d. Consider whether your choice of which of these would be the best set of instructions might change depending on the person following them. For example (you may think of other examples), would the best set change if: i. The person following them was already very familiar with San Antonio, or had never set foot in Texas. ii. The person following the instructions was using a POV, Uber, or another form of transportation. iii. The weather was dark and raining outside, or it’s a beautiful and sunny 75 °F. Briefly describe whether different sets of instructions might have been better options in other scenarios. e. This was a very open-ended question. What questions might you have asked to begin with in order to better know how your sequential steps should have been written? The point here is to help you understand the importance of requirements gathering at the first stage of attacking a problem – make sure you are solving the problem someone needs solved, rather than the one you want to solve . Activity #2 : Giving instructions – team Based upon Dr. Keyser’s Original 1 Revised Fall 2023 SNR
Lab: Topic 2 (team) This activity is meant to help you communicate clear instructions. First, choose one member of your team to be the speaker. Everyone else will be listeners. Have the speaker choose at least five basic shapes (circle, triangle, square, etc) and create abstract art on a sheet of paper. An example is shown below. DO NOT show the listeners your art. Next, give each listener a blank piece of paper and a pencil. Have the speaker describe their art in detail, while the listeners all attempt to recreate the image on their own piece of blank paper, based solely on the speaker’s instructions. The listeners may NOT communicate with the speaker The listeners may NOT communicate with each other The listeners may NOT view each other’s or the speaker’s paper until the drawing is complete After all of the listeners have completed their drawings, have everyone compare with the speaker’s original art. Create a pdf document named giving_instructions.pdf and answer the following questions. Use complete sentences with about 50 words in each of your answers. Include a picture of the art that everyone created in the document. 1. What about the speaker’s instructions worked well? 2. What about the speaker’s instructions was difficult to follow? 3. If you had to repeat the activity, what would you do differently? Example abstract art: Activity #3 : Linear interpolation – team The purpose of this activity is to practice writing simple programs that require multiple variables, and to ensure you understand the idea of interpolation. One of the individual assignments in the topic 2 lab will build on this program. Please refer to the posted material on Linear Interpolation . You are an engineer at NASA monitoring the International Space Station (ISS) as it orbits the Earth at a constant rate of speed. You want to be able to predict where the ISS is above the Earth at any point in time. To do this, you take a measurement of how far around the Earth the ISS has traveled at two points in time. Assume that NASA has very precise instruments for determining position. You note the time of the first position, and a short while later (before the ISS has completed one revolution), you take a second measurement for how far the ISS has traveled, again noting the time. Now, it’s your job to reconstruct the position of the ISS at any time between the first and second measurements. Since you assume the ISS is moving at a constant speed, this calculation can be found via linear interpolation. As a team, determine what variables you will need to use, and what formula(s) you will need to perform this calculation. You should use variables for all of the values that could change. Part 1. The first measurement was taken at time t = 10 minutes, and the second was taken 45 minutes later. At the first measurement, the ISS was 2,027 kilometers past Houston, TX. At the second measurement, the ISS was 23,027 kilometers past Houston. Based upon Dr. Keyser’s Original 2 Revised Fall 2023 SNR
Lab: Topic 2 (team) Write a program that determines, for any time between 10 and 55 minutes, where the ISS will be (in terms of kilometers past Houston). The time to evaluate at should be a variable in your program. The program should print both the time and the position at that time to the screen, with a line describing what is being output (see example output below ). You should test your program at various times and make sure the results seem reasonable. For your final program that you submit, output the position at a time of 25 minutes. (Next week, we will see how you can read in numbers from a user, but for now, just assume it is a fixed number of minutes.) Questions to think about : What happens if you enter t = 0 minutes as the time of interest? What is output as the position at that time? How do you interpret this result? Should the position at t = 0 minutes be at Houston? Suggestion : Hand draw a sketch of position versus time and plot the two known observations. Now, predict from the sketch what the calculated position will be for t = 0 minutes or for t = 1500 minutes. Part 2. Now, let’s make this a bit more interesting. The ISS orbits in a circle with radius 6,745 kilometers . Use the same observed data as before: at 10 minutes, the ISS is 2,027 kilometers past Houston, and at 55 minutes, the ISS is 23,027 kilometers past Houston. Assume its speed is constant. When a time is specified, we want to report the distance from Houston , not the total distance traveled. So, every time the ISS passes Houston, its “distance” from Houston gets reset to zero (0). So, if you go far into the future, say at a time of 5 hours (300 minutes), simple linear interpolation will not produce the result we want. You’ll need to modify your code to report distances correctly regardless of the time. Here are a few hints for Part 2: If we use the same code from above and enter a time of 300 minutes (5 hours), we calculate a distance greater than the orbit’s circumference. (Estimate that calculated distance from your plot.) However, we want to report a position of the ISS between 0 kilometers and the numerical value of the orbit’s circumference expressed in kilometers. We could do this using a series of subtractions. We could perform successive subtractions of the circumference from the total position until the result was between 0 kilometers and the numerical value of circumference in kilometers. That would represent the position with respect to Houston. If we were clever, we could also use “modulo division” in Python. (Remember from Lecture 1?) Questions to think about : Is this linear “extrapolation”? If so, why are we are we using linear extrapolation despite all the warnings not to use it? Is there ever a case when using linear extrapolation is acceptable? Another Question to think about : Will the code for Part 2 output the correct answer for time (t) of 25 minutes as was used in Part 1? Please put the code for Parts 1 and 2 into one file named linear_interpolation.py for submission to zyBooks. Include the team header at the top of your code (see Canvas for the header information). Use a comment to clearly label the two parts. Example output: Part 1: For t = 25 minutes, the position p = 9027.0 kilometers Part 2: For t = 300 minutes, the position p = 10220.078642554414 kilometers Based upon Dr. Keyser’s Original 3 Revised Fall 2023 SNR
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help