|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 12800 (0x3200) Types: TextFile Names: »LESSON2.PC«
└─⟦a6ed1cd35⟧ Bits:30002862 Perfect Calc 1.10 for JET80 CP/M └─ ⟦this⟧ »LESSON2.PC«
>a2:" LESSON2 -- Entering Data >a4:" In this lesson we will practice entering data in the Stock >a5:" Portfolio spreadsheet, (filename 'b:stockex.pc'), which we use in >a6:" Lesson 1. This spreadsheet already contains some data-- >a7:" labels, numbers, and formulas--but let us practice adding more, >a8:" beginning with numbers. >a9:" Let us begin by splitting the screen and calling up the 'stockex.pc' >a10:" file. Move the cursor to line 11 (the indicator in the lower right edge >a11:" of the screen should read 'a11' when you're there) and enter the >a12:" CREATE TWO WINDOWS Command: >a13:" Control--x 2 >a14:" ÆAnswer 'n' for "no", to the prompt "Sychronize windows?"Å >a15:" Next move the cursor into the other ÆtopÅ window using: >a16:" Control--x o (the letter 'o') >a17:" Use the 'Other Window' commands learned in the first lesson to >a18:" scroll the bottom window: >a19:" FORWARD: Control--x Control--v >a20:" BACKWARD: Control--x Control--z >a21:" Call up the 'stockex.pc' file. Enter the FIND FILE Command: >a22:" Control--x Control--f >a23:" When Perfect Calc responds, "File to Find <CR>: " enter the filename: >a24:" 'b:stockex.pc', followed by a carriage return. >a26:" NUMBERS >a27:" Perfect Calc distinguishes a number from a label or a formula, by >a28:" the first character that you type. That is, if the first character is >a29:" a ' - ' (hyphen, or minus sign), a ' . ' (period, or decimal point), >a30:" or any digit, 0 - 9, Perfect Calc assumes you are entering a number. >a32:" Using an appropriate cursor command or arrow key, move the cursor >a33:" to position 'c6' and type a value for the current price of Xerox stock, >a34:" e.g. $40. Type the number '40' (omitting the dollar sign) and hit >a35:" 'Enter' or 'Return'. (Use the DELete key to erase typing errors.) >a36:" At the first digit Perfect Calc displays the message "Number:" >a37:" in the Prompt Line. The number you type appears initially following >a38:" this message. It will not be entered into the spreadsheet until >a39:" you type 'Enter' or 'Return'. >a40:" After you hit the 'Return' key, Perfect Calc enters the number >a41:" and recalculates the spreadsheet, displaying a value of '8000' for >a42:" 'Current Value', position 'e6'. >a43:" Notice that numbers are displayed showing two decimal places, >a44:" which is Perfect Calc's default display notation. In Lesson 6 we >a45:" will see how this can be changed. >a47:" FORMULAS >a48:" Formulas express the relationships that exist among the data >a49:" held in your spreadsheet. For example, a formula for your home >a50:" 'expenses' might be: Expenses = Rent + Utilities + Food. In general, >a51:" formulas consist of numbers, variables, arithmetic operators, and/or >a52:" functions. Arithmetic operators are the common symbols of arithmetic >a53:" that we are all familiar with: >a55:" ^ To the power of (e.g. 3^2 means "3 to the power of 2", >a56:" or 'three squared' or 3 x 3 = 9) >a57:" * Multiplication >a58:" / Division >a59:" + Addition >a60:" - Subtraction >a61:" Move the cursor to position 'e6', which records the 'Current >a62:" Value' of the Xerox stock. The formula for this position, as displayed >a63:" in the Prompt Line, instructs Perfect Calc to multiply ( * ) whatever >a64:" value is contained in position 'b6' ('Number of Shares') by whatever >a65:" value is held in position 'c6' ('Current Price'). This result is then >a66:" displayed in position 'e6' ('Current Value'). >a67:" As you can see, only the value which the formula computes displays >a68:" on the spreadsheet, while the formula itself ÆFormula: b6 * c6Å >a69:" displays in the Prompt Line, and then ONLY when the cursor is occupying >a70:" the entry position that contains it. >a71:" Let us enter a formula. Move the cursor to position 'f6', which >a72:" records 'Percentage Gain/Loss'. This entry position will hold a >a73:" formula that will compute the percentage we have gained or lost on >a74:" our investment in this stock. The formula will be: >a76:" f6 = (c6 - d6) / d6 >a78:" This instructs Perfect Calc to subtract the Purchase Price from >a79:" the Current Price, and to divide the result by the Purchase Price. >a80:" The result will be displayed in position 'f6'. >a81:" With the cursor at position 'f6' type an equals sign ( = ). >a82:" This tells Perfect Calc that you wish to enter a formula for this >a83:" position. Start typing the formula now. Again, it will be: >a85:" FORMULA: f6= (c6 - d6) / d6 >a87:" Blanks are ignored by Perfect Calc and so may be inserted >a88:" for readability. If you make a mistake, use the DELete Key to backup >a89:" and retype. As you did with numbers, type the formula at the prompt >a90:" line and then enter it onto the spreadsheet with a carriage return. >a91:" Perfect Calc recalculates the spreadsheet displaying a result >a92:" of '-0.20' in position 'f6', indicating that a loss of 20 percent has >a93:" occurred for this stock. Actually, percentages should be displayed >a94:" as whole numbers, not as decimal fractions. Let us change the formula >a95:" so that it will do this. >a96:" Perfect Calc provides a very convenient method of changing >a97:" a formula (or label) entry, which does not require retyping the entire >a98:" entry. Called the EDIT ENTRY Command, it cause the formula which the >a99:" cursor is occupying to be displayed in the Prompt Line, where you >a100:" you may change it however you wish. To help you, Perfect Calc >a101:" modifies several of its commands: >a103:" Control--a Moves Cursor to BEGINNING of Prompt Line >a104:" Control--e Moves cursor to END of Prompt Line >a105:" Control--f Moves Cursor FORWARD one character >a106:" Control--b Moves Cursor BACKWARD one character >a107:" Control--d DELETES character occupied by the cursor >a108:" DEL Key DELETES characters backward >a109:" Control--g CANCELS changes made & returns to original formula >a110:" Return key Enters the modified formula. >a111:" At this time, with the cursor on position 'f6' type the EDIT >a112:" ENTRY Command: >a113:" Control--x e >a114:" Perfect Calc responds by displaying the formula in the Prompt Line: >a115:" EDIT: (c6 - d6) / d6 >a116:" Using the above editing commands, change the formula to read: >a118:" f6 = ((c6 - d6) / d6) * 100 >a119:" When you have finished, enter the modified formula into the >a120:" spreadsheet using a carriage return. Perfect Calc automatically >a121:" recalculates the spreadsheet, displaying a new value of '-20.00' in >a122:" entry position 'f6'. >a124:" FUNCTIONS >a125:" Now let us consider a formula containing a simple function. A >a126:" function is a kind of pre-structured formula which performs a >a127:" mathematical operation, and which would be difficult or time consuming >a128:" to structure ourselves. Functions perform such operations as computing >a129:" sums, averages, square root, and so forth. >a130:" Move the cursor to position 'e18', the entry which will compute >a131:" 'Current Equity'. This figure, which is the sum of all values in >a132:" column 'e', will represent the total current worth of the stocks we >a133:" own. Presently, we have only one stock, Xerox, showing a total current >a134:" value of $8000. However, in a few moments we will be adding stock for >a135:" other companies into lines 6 through 15. We could write our formula >a136:" as follows: >a137:" e18 = e6 + e7 + e8 + e9 + e10 + e11 + e12 + e13 + e14 + e15 >a138:" This would give us the correct total. However, it is an awkward >a139:" formula, and if we add more than 8 stocks, we will have to rewrite it. >a140:" Perfect Calc provides an answer with its 'sum' function, which >a141:" will compute the sum of variables over a 'range'. A range is simply >a142:" any continuous series of entry postions, whether in a line, a column, >a143:" or a rectangular area of both lines and columns. The entry positions >a144:" 'e6' through 'e15' represent a columnar range of values. Using the >a145:" sum function we can write our formula very concisely, as follows: >a146:" e18 = sum(e6:e15) >a147:" Notice that the range is enclosed in parentheses and follows right >a148:" after the function name, leaving no blank space. As well, the range is >a149:" specified by the first and last entry positions, separated by a colon. >a151:" Enter this formula into entry position 'e18': >a152:" FORMULA: e18=sum(e6:e15) >a153:" Use the equal sign '=' to start the formula entry. This entry recalcu- >a154:" lates the spreadsheet displaying a value of $8000 for 'Current Equity'. >a156:" Perfect Calc provides a large number of built-in functions similar >a157:" to the 'sum' function. These include virtually all of the built-in >a158:" functions found on other electronic spreadsheet programs. However, as >a159:" we will learn in lesson8, it is possible to build a 'user-extendable' >a160:" functions library which makes the number of functions available >a161:" virtually limitless. Let us examine the current built-in functions >a162:" listed in the Help Menu: >a163:" Type Help: ? and select '5'. >a164:" NOTE: To return to these instructions scroll the bottom window using: >a165:" Control--x Control--v >a172:" LABELS >a174:" The last type of data entry we will examine are labels. Labels >a175:" are those words and symbols in the spreadsheet that identify the >a176:" various lines, columns, and entry positions. At present there are more >a177:" labels on our spreadsheet than numbers and formulas. Labels make >a178:" the spreadsheet not only easy to use but also aesthetically pleasing >a179:" to view. No computations are performed on labels. >a181:" Any printable character which does not begin a command, a number >a182:" or a formula may begin a label. However, should it happen that a label >a183:" must begin with, for example, a hyphen, an equals sign, or a period, >a184:" which would otherwise signal a number or a formula, the label can be >a185:" 'forced' by typing a double quote ( " ) before beginning the label. >a187:" Move the cursor to entry position 'a7' and type the label 'IBM'. >a188:" As with numbers and formulas, the label is displayed initially in the >a189:" Prompt Line following the message: "LABEL: ". Instead of entering >a190:" the label with the return key, use the FORWARD Command (Control--F). >a192:" Notice that Perfect Calc enters the label, and then moves the >a193:" cursor right one column position, where it is ready to receive a >a194:" numeric value for 'Number of Shares'. >a196:" Make up and enter sample numbers for IBM stock. Each time a number >a197:" is entered, Perfect Calc recalculates the spreadsheet. When you have >a198:" finished with IBM, enter stock holdings for other companies, such as >a199:" General Motors, Bank of America, Georgia Pacific, etc. >a201:" Once the data has been entered, change the 'Current Price' for >a202:" various stock, observing how Perfect Calc automatically recalculates >a203:" the current value of your stock holdings, your percentage gain or loss >a204:" for each, and your current equity. >a206:" THIS is the power of Perfect Calc! >a208:" When you have finished, and if you wish to continue to the next >a209:" lesson, which deals with storing and printing the spreadsheet, simply >a210:" clear the entire memory and read in the 'lesson3.pc' file. >a211:" The CLEAR ENTIRE MEMORY Command is: Control--x Control--k >a213:" The FIND FILE Command is: Control--x Control--f >a215:" If you do not wish to continue with the lessons now, type the >a216:" QUIT Command: >a217:" Control--x Control--c >a218:" Answer 'y' for yes to Perfect Calc's question: "Ignore changes >a219:" this session?" >a220:" END OF LESSON 2 >a1 «eof»