Introduction to Computer Science Lab
Midterm
10/17/2016
1. Build a world containing a person who can calculate Einstein’s formula e =
m* C 2 in his or her head, where the user enters the m value (mass, in
kilograms), and c is the speed of light (299,792,458 meters per second).
Define descriptive variable for each quantity, and define a function to
calculate the formula. Use the world function pow() to computer C 2 . (50
points)
2. Choose a hopping animal from Alice Gallery (for example, a frog, a bunny,
etc.). Write a hop() method that makes it hop in a realistic fashion, with a
parameter that lets the sender of the message specify how far the animal
should hop. Using your hop() method, have your animal hop around a
building in four hops. (50 points)
Present your Alice code to the instructor, and submit them to Ecourse.
Get Free Quote!
393 Experts Online