< Back

Assignment 1

This is a pair assignment. You should create a directory called assignment1 in cs120/assignments for this assignment. All code written for this assignment should be stored in that directory.

$ cd ~/cs120/assignments
$ mkdir assignment1
$ cd assignment1


Lift-off!

This assignment was inspired by XKCD What if? #24: Model Rockets


Over the past 50 years, spaceflight has become more technologically advanced. While NASA's prospects on manned spaceflight have fizzled out, commercial spaceflight is just around the corner. For the low, low price of $250,000, you to could travel to the edge of space and back. However, one does not necessarily have to wait that long to get to space, or spend that much money...or do they?

Estes is a company that makes model rocket engines. One of their most powerful, but commonly available, model engines is the E9. The E9 engine provides 28.5 Newton/second of thrust. Given that an average human being weighs about 160 pounds, let's figure out how many model rocket engines are needed to lift the human off the ground.


Details

Create a program called lift_off.py. This program should print the information about lifting a human off the ground. In particular, your program should print:

  1. The equation you derived to determine the number of rocket engines required to lift the human off the ground,
  2. How many rocket engines are required to lift a 160 pound human being, Assuming all thrust is additive,
  3. Assuming three rockets come in a pack, how many full packs of rockets are used,
  4. In the (potentially) not fully used pack, how many rockets are left over,
  5. And assuming each rocket engine weighs 35.8 grams, how much the collection of rocket engines weighs.

Remember 1 N = 1 kg/s. For a vertical launcing rocket, lift-off requires the thrust to exceed the the gravitational force (9.81 N) on the object being lifted. You can assume weightless rockets, though this is generally a bad assumption.


"Hacker" Prompt


Each week, additional exercises related to the assignment will be provided at the end. These exercises are typically more challenging than the regular assignment. Bonus points will be provided to students who complete any of the "Hacker" level assignments.

  1. Cost of travel: For this mechanism to be worth while, we really need to know how much it would cost to lift an average human off the ground. Assuming each pack of rockets costs $54, how much does the launched monstrosity cost?
  2. To Infinity: Of course, that's just to get the person off the ground. Where's the fun in that?!? Compute how many rockets would be necessary to get the human 1000m in the air! Keep in mind that the Estes E-9 burns for ~3 seconds. You can assume all thrust is immediate.
  3. Weight of the Rocket: Your code above likely assumed that the rocket engines had no weight, for the purposes of HP-II. So, how could you factor that into your calculations? Factor in weight of the rockets into your solution for HP-II.
  4. What if?: The idea for this assignment came from the web site xkcd what if? Read through some other questions, and create a program that performs the calculations.

Creative: Drawing

Computers can be powerful tools for artists. Their ability to represent curves and lines precisely make them a useful to for graphic designers. In this assignment you will use the Turtle module as a computer aided design tool.

Details

Create a Python program that uses the turtle module to draw a picture. The picture can be anything you want, but must do the following:

  • Have a single variable that specifies the size of the entire drawing. Note, this implies that changing the single size variable will change the size of the entire drawing.
  • Use both the all of the following functions at least once:
    1. forward
    2. goto
    3. up
    4. down
  • Use more than one color.
  • Draw something filled and something not filled.
  • Be impressive.

Here are some examples of drawings from last year's class that were impressive:

Turtle Graphics Yin Yang Symbol Turtle Graphics Green Lantern Symbol

Extra

Astounding drawings will receive extra credit. I will be the arbiter of whether a drawing is astounding, but as a general rule they should be more impressive than the above examples.


Your program should include the traditional header, use appropriate variable names, and nicely label all values printed to the terminal. Submission are to be done through inquire.roanoke.edu through the Assignment 1 link. Both partners must submit through cseval!