EngE_1104_Spring_2007_Lab_5_Students_Copy_V1B -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Explorations Of Our Digital Future Spring 2007 Lab 5 – Scripts and Functions in Raptor and MatLab Version 1B, Copyright by: Jeremy Garrett and Tom Walker, Feb. 7, 2006 – Jan. 2007 Preparation: Install Raptor BEFORE coming to class. In addition to being available on Blackboard, Raptor can be downloaded from: http://www.usafa.af.mil/df/dfcs/bios/mcc_html/raptor.cfm No lab warm-up required for this particular lab. Lab Objective: To be able to use standard flowcharting symbols in Raptor as well as other environments. To be able to distinguish the difference between a “script” and a “function.” Lab Overview: In this activity we will further explore functions, using the quadratic formula, in both MatLab and “Raptor,” a flow-chart-based programming language. Part 1 – Using Raptor to Create a Flow Chart for Your Quadratic Equation Script: Part 1 – Background: As you may have already learned in your other classes (such as the EngE 1104 lecture), when a new product (such as a computer program) is developed, a lot of time (and frustration) can be saved by using methods that allow for mistakes to be caught early, and that a lot of methods have been devised to do just that. Using flowcharts is one of the most common methods for achieving these cost and time savings. Raptor, which we will be using, not only allows us to make the flowcharts quickly and easily, but it will actually execute those flowcharts as if they were completed programs. Part 1 – Procedure: Open/launch the Raptor flow chart program. Before continuing, save your blank (with only Start and End) flow chart, with a filename of your choice. Begin work on your flowchart by right clicking on the item labeled “Start” and select comment. In the space provided, make the first comment line contain your name, have the second comment line contain “EngE 1104,” and have the third comment line contain the date. Now make the fourth comment line a description (using your own words) of what your
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
script file does – which in this case is the solving of the quadratic formula. In order to add the first input command, simply click on the input parallelogram on the left-hand side of the screen, and then click on the spot that you would like to insert it at. Then double click on your new, blank parallelogram, and then examine the new window that opens. Make sure that “text” is selected at the top of this new window. Then, in the upper box, type in a phrase or sentence in which you ask the user for the coefficient A. Then enter the letter A into the lower box, and then click “Done.” At this point your flowchart should look like a lot like this: Start "Enter coefficient A " GET A End %Mr. Garrett %EngE 1104 %Feb. 6, 2006 %Code to solve for roots of quadratic equation Now repeat the steps above in order to create input commands that ask the user for coefficients B and C. Now create an “if-then” statement by clicking
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/19/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Page1 / 9

EngE_1104_Spring_2007_Lab_5_Students_Copy_V1B -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online