

calculate speed of rocket at certain time calculate height of rocket at certain time If the rocket accelerates at a constant rate g, it reaches a speed of g * t in t time units and a height of 1/2 * v * t where v is the speed at t. Obviously, the solution with the multiple definitions evokes more confidence, because you can develop a higher order function before getting into the details of the lower order functions.ĭevelop the program height, which computes the height that a rocket reaches in a given amount of time. (define (area-pipe radius length thickness-wall) area-pipe : number number number -> number area-pipe-wall : number number -> number (area-circle (+ inner-radius thickness-wall)) (define (area-pipe-multi inner-radius length thickness-wall) Solution area-pipe number number number -> number The program consumes three values: the pipe's inner radius, its length, and the thickness of its wall.ĭevelop two versions: a program that consists of a single definition and a program that consists of several function definitions.

It computes the surface area of a pipe, which is an open cylinder. example: (circumference-circle 4) -> 25.13272ĭevelop the function area-pipe. Solution area-cylinder : number number -> number Its result is the surface area of the cylinder. The program consumes the radius of the cylinder's base disk and its height. example: (volume-cylinder 4 4) -> 201.06176ĭevelop area-cylinder. Solution volume-cylinder : number number -> number It consumes the radius of a cylinder's base disk and its height it computes the volume of the cylinder. Solution inches->cm : number -> numberĭevelop the program volume-cylinder. Use variable definitions to specify constants. Hint: Reuse functions as much as possible. Then develop the functions feet->cm, yards->cm, rods->inches, and miles->feet. Here is a table that shows the six major units of length measurements of the English system:ĭevelop the functions inches->cm, feet->inches, yards->feet, rods->yards, furlongs->rods, and miles->furlongs. So, people who travel abroad and companies that trade with foreign partners often need to convert English measurements to metric ones and vice versa. The rest of the world uses the metric system. For example, you could produce labels that have only the first letter of each word capitalized, regardless of how the text strings are stored in the attribute fields.īoth regular and advanced label expressions can be saved as label expression files (.lxp), which can be loaded into other layers or maps.The United States uses the English system of (length) measurements. Using an advanced label expression, you can add any Python, VBScript, or JScript logic to your label expressions, including conditional logic and looping.

Using advanced label expressions is a more powerful option. For example, you might show precipitation values with italicized, blue text and wind speed values in regular, black text. Text formatting tags let you specify different text display properties for different portions of your label text. You can further control how text appears on the map using ArcGIS text formatting tags. For instance, you could insert a function to make precipitation values appear on one line of text and wind speed values appear on a second line. You can also use Python, VBScript, or JScript in your label expression to change how the text is displayed. For example, on your weather map, you could add abbreviated measurement units to each label (for example, in for inches and MPH for miles per hour). You can insert your own text in the label expression to have it appear with your labels on the map. Learn more about creating label expressions Each label class has its own label expression. Whether your labels are based on one attribute field or many fields, the statement that determines your label text is called the label expression. For example, you might label your weather stations with both daily precipitation and maximum wind speed. If no field with that text in its name exists, it defaults to the first field of string type, then the first field of integer type, then the first field of any type.You can add attribute fields to your labels. This label field defaults to the first field of string type that contains the text "name" in its name (case insensitive).
