<<

Appendix A – Introduction and Tutorial to StarOffice

Appendix A contains a quick introduction to using StarOffice spreadsheets. It assumes that you have no knowledge of spreadsheets and little knowledge of . Many people, if not most people, can safely skim these sections, or skip them altogether.

Part One – Getting Around

Lets begin by opening a . Start by launching StarOffice. On your JDS (Java Desktop System ) desktop, click on the “LAUNCH” button. This will bring up a menu with a list of options. Click on the “StarOffice” menu item. This will bring up a window with a title of “Templates and Documents – New Documents”. The “New Document” icon should be highlighted. Double click on the spreadsheet icon . This will bring up a blank, new spreadsheet. Across the top of the spreadsheet you will find the Title Bar. When you open a new spreadsheet the title bar will probably has the word “Untitled” written across the top. After you give your spreadsheet a title, by saving it, the word “Untitled” will be replaced with the title that you gave the spreadsheet.

Just below the Title Bar, you will see the Menu Bar. The Menu Bar consists of menus. The menus on the Menu Bar are File, Edit, View, Insert, Format, Tools, Window, and Help. Lets go ahead and give our spreadsheet a title and save it. To accomplish this click on the word File. This will bring up a menu of commands. Click on “Save As ...” This will bring up a window titled “Save as”. Just below the Title Bar on the left hand side, you will the name of the directory where the spreadsheet will be saved. It may read something like: /root/Documents. If you want to save the spreadsheet in another directory, use the three icons to the right. The first icon is to go up one level, the second icon is to start a new directory and the third icon is to chose the default directory. Lets save our spreadsheet as spreadsheet1.sxc in a new directory named /root/documents/my_dir/ . Start by clicking on the second icon which creates a new directory. Enter the name my_dir into the space provided and click okay.

Now in the large box in the center of the “save as” window, you will see the folder named “my_dir” listed. This data box shows the Title, Type, Size, and Date Modified of the files and directories in the present directory. Click on the directory that you just created named “my_dir”. Notice that the present working directory listed at the top left is now /root/Documents/my_dir.

Now in the data box labeled “File name:”. Enter the name for the new spreadsheet: spreadsheet1. You do not need to enter the extension. It will take the extension of the file type listed in the File Type data box. Make sure that the File Type is spreadsheet (.sxc) and press “Save”. If you know look at the title bar, it should read spreadsheet1.sxc.

So far we have talked about the title bar and the menu bar. Just below the menu bar there may be one or more toolbars. The toolbars, as the name suggest, provide tools for use in the spreadsheet. The toolbars are made visible through the View menu on the menu bar. Click on the View menu and then click on toolbars. The toolbars listed , Object, Main, and Formula. The toolbars toggle on and off by clicking on them. A check mark to the toolbar means that it will be visible.

The function toolbar has a pull down list of files that have been active. The pull down list window shows the name of the active spreadsheet. The pull down list is useful for switching between and loading recently used files. Next to this pull down list are icons for creating a new file, open a file, save a file, edit a file, write a file out as a PDF document, print, cut, copy, paste, undo, redo, and more.

The object toolbar starts with a pull down list for font type and font size. The next four icons are for formatting text in a cell. They are icons for bold, italics, underline, and a font color. The next four icons are for align left, align center horizontally, align right, and justified. The next five icons are for formatting in a cell. The first is for currency, the second for percentages, the next for standard format, the final two are to add and subtract decimal places. The two remaining toolbars will be discussed later.

Menu Bar Function Toolbar Object Toolbar Formula Toolbar

Main Toolbar

If you look at the main area of the spreadsheet, you will notice that it is divided into rectangles called cells. This is where your data will go. The cells are referenced by the column and row they are in. The columns are labeled by capital letters and the rows are labeled by numbers. The columns are labeled A to Z for the first twenty-six columns, The twenty-seventh column is labeled as AA, next is AB, and so on. The cell is referenced by the column letter and the row number. You can move around the spreadsheet by using the scrollbars on the bottom and side. Pressing the key on your keyboard will return you to cell A1. Data can be placed in the cell or existing data can be modified when the cell is active. One way for the cell to become active is by taking your mouse and placing it over the cell and clicking on it. The active cell shown is cell C3. You may notice that the C column label and the 3 row label are highlighted. Also notice that there is a highlighted border around the cell C3. And “C3” appears in the Sheet Area pull down dialog box at the beginning of the Formula Toolbar. Data can be placed in the cell by making it active and typing in the value. The data placed in the cell can be text (also called strings) or numerical data. Lets place the value of 7 in cell C3. Click on the cell, type 7, press enter. Notice that after pressing enter cell C4 became the active cell. Enter the value of 19 into cell C4.

Notice that when the cell is active, the the cell reference appears in the “sheet area pull down box” on the Formula Toolbar. The data the cell contains appears in the Input Line on the Formula Toolbar. You can edit the value of the cell by making it active and either editing inside the cell or on the Input Line.

Now lets add these two numbers together. Cell will not only accept strings and numerical data, but also will accept formulas. To enter a formula, first enter an equal sign. Make cell F5 active by clicking on it. Enter =7+19 and press . Notice that the cell F5 now contains the number 26. Notice that while the cell is active, the Input Line on the Formula Toolbar contains the formula =7+19. You can also enter formulas using cell references. For example, lets add the value in cell C3 to the value in cell C4. Lets put the answer in cell C5. Move to cell C5 and click on it to make it active. Type in the formula =C3+C4 and press . You will now notice that the cell C5 contains the value 26 and while cell C5 is active, the formula =C3+C5 appears on the Input Line of the Formula Toolbar.

Let's go ahead and delete the contents of cell C5. Click on cell C5 and then click on the Edit menu on the Menu Bar. Click on the line Delete Contents ... This will bring up a dialog box with choices on what to delete. For now click on the Delete all option. This will delete the contents of the cell C5. If you accidentally edit something or change you mind about the editing, you can often undo the editing by using the Undo option under the Edit Menu on the Menu Bar.

Let's add the values of cells C3 and C4 again. This time instead of typing the cell references (i.e. C3 and C4) we will reference cells C3 and C4 by selecting them with the mouse. Click on cell C5 and to make it active. As always, start a formula with an equals sign. In cell C5 enter the formula = + . The resultant should be 26 visible in cell C5. When cell C5 is active, you will see the formula =C3+C4 on the Input Line on the Format Toolbar.

Now you know how to enter and edit numerical values and formulas in the cells. You can also enter text data or strings in the cells. Next we will add some text in cell B5 to remind us what cell C5 contains. If you remember, cell C5 contains the sum of cells C3 and C4.

Make cell B5 the active cell by moving the mouse over it and clicking on it. Enter the string “ SUM =” and press return. You do not need to type in the quotes. Now you have seen that cells can hold numerical values and text. You can change the formatting of any cell by making the cell active and using the icons on the Object Toolbar. Make B5 the active cell and change the formatting of the cell by clicking on the icon for Bold on the Object Toolbar and the icon for Italics on the Object Toolbar. Now change the font type to Arial Narrow by using the Font Name pull down dialog box.

Font Name pull down dialog box

Bold Icon

Italics Icon By now, you should be able to enter and edit data into cell, enter formulas into cells, delete the contents of cells, format cells and save your spreadsheet. You also should be familiar with the toolbars and menus in the spreadsheet. For now let's go ahead and close our spreadsheet and delete it. You can close your spreadsheet by using the Close option on the File Menu. When you do this a dialog box will appear asking whether to save or discard changes. You can save them. If you would like to delete your spreadsheet (it was only for practice and you will not need it again) you can delete it. Remember, once you delete the file, it is gone forever. One way to delete the file that we named spreadsheet1.sxc in directory /Documents/my_dir is to open the Documents folder on your JDS desktop by double-clicking on it. Next double-click on the folder named my_dir. Highlight the file spreadsheet1.sxc and press on your keyboard. What this does is to place the file into the Trash. It is recoverable from the Trash, but once you delete it from the Trash, it is gone forever. Part Two – More on Equations, Formulas and Functions

This section provides a deeper discussion on formulas. Let's start by opening a new spreadsheet. Go ahead and name practicesheet.sxc it by saving it in the directory / Documents/my_dir.

In the last section, we considered a simple formula, we added together the contents of two cells. You'll find that the StarOffice spreadsheets can do much, much more. To start with, parenthesis can be used. You can also use addition (+), subtraction (-), multiplication (*), and division (/), and exponent (^). Whatever is inside the parenthesis is done first, and there can be several pairs of parenthesis and they can be nested. The order of execution of the nested parenthesis is that the most inner set of parenthesis are computed first. The order of execution after the parenthesis is the exponent (^), then multiplication (*) and division (/), and then addition (+) and subtraction (-). It is highly recommended that you use parenthesis liberally (with common sense, too many parenthesis can make the equation unreadable to the human eye) , and do not count on the order of operations listed above.

Consider the equation:

0=3 x 2−9 x2

The solution is the solution of this equation is the familiar quadratic equation:

2 −b± b −4 ac 2 x=  where ax bxc=0 2a

Let's solve for the positive root. To solve, move to cell A2. Enter the equation:

=(-(-9)+((-9)^2-4*3*2)^0.5)/(2*3) that the equation is shown on the formula toolbar. The solution should be 2.76. After you have convinced yourself that you have gotten the correct answer, you can go ahead and delete the contents of cell A2. If you have to solve the quadratic equation several times a day. It would quickly become monotonous to continuously enter the above equation. Instead you can give a cell a name, just like you can name the variables in the quadratic equation (a,b, and c). Start by enter the text “a=” into cell E1. Enter “b=” into cell E2. Enter “c=” into cell F3.

If you recall we are trying to find a solution for:

0=3 x 2−9 x2

Enter the value for 3 in cell F1, -9 into F2, and 2 into F3. Next, you will want to create the three variables a,b, and c. And for now, you want the variables a, b, and c to hold the values 3, -9 and 2, respectively. There is an easy way to do this. All you need to do is highlight the cells that contain the variable names and the cells that contain the values that you want the variables to be equal to by clicking on cell E1 and dragging to cell F3. Under the Insert menu there is a menu item Names and an option for Create . A dialog box will come up and ask if the names are in the top row, left column, right column of bottom row. In this case the names are in the column to the left. Click on the box for the left column and press the okay button on the dialog box. This will create the three variables a, b, and c.

If you click on the cell F1 to make it become active, you will notice in the sheet area drop down box on the Formula Tool Bar that the name of the variable appears instead of the cell name. You may notice that the name appears as “a_” instead of “a”. If ever you use the variable names “a” through “z” or “a1” through “z1” or a single letter followed by any number, the name will automatically be changed to the name followed by an underscore. This is to prevent confusion with the variable and the column and row notation. Recall, you can reference cells by the column letter and row number (ex: A1). One way to get around this is not to use the equals sign (=) when defining variables. For now lets keep of definitions as the are, i.e. a_, b_ and c_. Move to cell F9. Enter the formula : =(-b_ + (b_^2-4*a_*c_)^0.5)/(2*a_)

The solution for x which is 2.76 should appear in cell F9. The real power lies in the fact that you can easily change the value of your variable “a” by changing the contents of cell F1. Change the value for the variable “a” from 3 to 10. Your answer in cell F7 should change to 0.5 and should appear in cell F9.

StarOffice has a library of function you can use in your calculations just by inserting them. An example of a function is the sqrt() function which takes the of the arguments inside the parenthesis. Go to cell F11 and enter the formula

=(-b_+sqrt(b_^2+4*a_*c_))/(2*a_) and press return. You should see the answer which is 0.5

There are a vast amount of other functions available. Go to the Insert Menu on the Menu Toolbar and then choose Functions... A dialog box will appear that contains a list of functions. If the select one of these functions ( such as sqrt() ) you will see a short description and the syntax of the function. You can use this dialog box to insert the function into your cell. This dialog box is very powerful, but I'll leave it up to you to investigate further how powerful it is.

Some functions take arguments and some do not. One such function that does not accept arguments is pi(), which prints out π to fourteen decimal places. The parenthesis are necessary to let StarOffice know that it is a function. By the way, the functions are not case sensitive. An example of a function must have an argument is the square root function, sqrt(). The argument could be a number, sqrt(9), a cell reference, sqrt(A7), a defined or created variable, sqrt(a_), or even an equation, sqrt(b_^2-4*a_*c_). It can also be used inside another equation or function. Another tip I can offer to you if you will use functions often is to have the function list available on the side of the spreadsheet. Use the function list option under the Insert Menu. There is an arrow on the top of the list that will allow you to hide the list but keep it quickly available.

Part Three – Making

In this section we will demonstrate how to make a or plot of data. The chart we will make will be a plot of the sine function. This will be a two step process. First the data points we will need to plot have to be created. Then the chart can be created.

Lets start with a clean sheet. Instead of opening a new file lets start a new spreadsheet in our existing file. Choose the Sheet option under the Insert Menu. This will bring up a dialog box. Here you can choose where to place the sheet, that is before or after the current sheet. Choose after the current sheet. You can also create a new sheet or add one from another file. Choose New Sheet. You can also name the sheet. There will be a default name. We will choose our own name. For now name the sheet: sine function. After you are finished, click on the OK button. You will now see at the bottom of the spreadsheet a few tabs, probably labeled as Sheet1, Sheet2, Sheet3 and one labeled sine function. The active sheet should have the label of the name you gave it: sine function. To move between sheets, just use your mouse button and click on the tab.

Now that you have a spreadsheet named “sine function”, let's make a chart of a sine function. The sine function is:

f  x= A sin x

Where A is the amplitude of the sine function. You will need to set up values for the independent variable, x, and then calculate the values for f(x), i.e. the dependent variable, y. The dependent variable is also called the ordinate. The set of values to use for x (the abscissa) will be {0, π/6, π/3,π/2, 2π/3,5π/6, π,...4π}. This set is of the form {x0, x1, x2, x3, ...} where x1= x0+dx, x2= x0+2*dx, x3= x0+3*dx, etc. Abetter way to look at this series is that this set is of the form {x0, x1, x2, x3, ...} where x1= x0+dx, x2= x1+dx, x3= x2+dx, etc. You will plot twenty-five points. First you will need to define the amplitude of the sine function (A) , the initial value for the independent variable x, the the value for the change in x. These will be the variables A, x0, and dx. For this exercise use A=4, x0=0 and dx=π/6 . Go to cell A2 and enter A= and press . Enter the value 4 into cell B2. Go to cell A3 and enter x0= and press . Enter the value 0 into cell B3. Go to cell A4 and enter dx= and press . Enter the formula =PI()/6 into cell B4. Go ahead and and chose the cells A1 to B3 and use the Insert menu and go to Names and Create to create the the variables A, x0, and dx. A good habit to get into is to format spreadsheets so that the user can easily use the spreadsheet. One habit that will be used throughout this book is that values that the user will input (like the amplitude of the sine function, A) will be surrounded by a border. They will also be labeled by the word, INPUT. Go to cell A1 and enter the word INPUT.

Next place a border around cell A2 to cell B4. Highlight the cell A2 thru B4 by placing the mouse over cell A2, pressing and holding the left mouse button, and then dragging to cell B4 and releasing the mouse button. The go to the Format Menu and chose Cells. From there chose the Borders Tab. From here you can chose the thickness of the border in points. In the example the border thickness chosen is 2.5 pt. You can also chose defaults for the Line arrangement. The defaults are no borders, set outer borders only, set outer borders and horizontal lines only, set outer borders and all inner lines, and set outer borders but do not disturb inner lines (in case borders have already been set inside the area you have highlighted). Go ahead and choose the default option to set outer borders only. Now the points needed for the abscissa and ordinate need to be created. Label two columns: x, f(x). Go to cell B6 and enter the test “x”. Then go to cell C6 and enter the text “f(x)”. Format those two cell so the they are “Center Justified”. You can do this by highlighting the cell and using the “Center Justified” button on the object toolbar. Next, set up the points for the abscissa, x. Go to cell B7 and enter the value for x0. To do this enter the formula =xo_ and press . The value that appears should be 0. In cell B8 enter the value for x1. To do this enter the formula =B7+dx_ and pressing . Now, you could go to cell B9 enter the value for x2 by entering the formula =B8+dx_ and pressing . Luckily, there is a better way. You can use the “Fill Down” function. Highlight cell B8 through B31. Go to the Edit Menu choose Fill and then Down. (You can also fill Up, Right, and Left when needed.) This will set up all of the values needed for the independent variable, x. Go ahead and format the the values you just created to be center justified.

Go ahead and use the create name function of StarOffice to define these newly created values to be designated as values for x. All you need to do is to highlight the cell B6 to B31 and use the Insert – Names - Create option of StarOffice and choose the Top row option.

Now the dependent variable, f(x), need to be calculated. Go to cell C7. Enter the formula =A_*sin(x) . The value that appears should be 0. Next, use the fill down function to create the remaining values. If you remember, all you need do is to highlight the cells where that you want to contain the formula and use the Edit – Fill – Down Option. StarOffice actually has a shortcut to complete this operation. After you entered the formula in cell C7 and pressed return, you probably notice a little square box to the lower, right hand corner of the cell C7. This is the “fill box”. You can use it to fill down the formula. Click on the box and drag down the column until you reach cell C31. After you are done filling down, go ahead and format the column so that it is “center justified” and has two decimal places.

Fill Box Now for the plot. Go ahead and highlight cells B6 through C31. Next pick the Chart option under the Insert Menu. Since you highlighted the ranges, the chart program has entered in the range. Notice the check box labeled “First row as labels”. Checking this box recognizes the first row of the cells you selected as the labels of the axis. There is also a drop down menu to chose where the chart will go. The default is the sheet you are working in.

After clicking on next, the next dialog box lets you chose the chart type category. The categories available are x-y charts, pie charts, line charts, and 3D charts. Pick the x-y Plot.

The next dialog box will let you chose what type of x-y chart. Chose the x-y plot with smoothing. In the final dialog box you can add a title, a label for the x axis and a label for the y axis. Finally, click on the create button. And this will embed your chart. This has been a short tutorial that has not scratched the surface of the powerful features of the StarOffice Suite. As we go through our studies of waves and harmonics, you will learn much, much more.