SlideShare a Scribd company logo
Labs/Lab5/Lab5_Excel_SH.htmlLab 5: SpreadsheetsLearning
Outcomes and IntroductionTask 1: Powers of 2, Powers of 10
Task 2: Importing and Sorting DataTask 3: Graphing DataTask
4: FunctionsSubmission
Learning Outcomes and Introduction
During this process, you will be able to: Demonstrate your
ability to layout and format a spreadsheetDemonstrate the use of
relative vs. absolute references in spreadsheetsDemonstrate the
use of functions in ExcelDemonstrate the use of IF and
VLOOKUP in Excel
Task 1:Powers of 2, Powers of 10 (20 marks)Instructions
There is a reasonably close relationship between
the powers of two and the powers of ten: 210 is a little more
than 103, that is, 1024 is close to 1000. Similarly, 220 is more
than 106
and the ratio is 1.049. The approximation is
pretty good for a long distance though eventually it breaks
down. Your task is to make a spreadsheet that shows
how good the approximation is and find the
place where the ratio first becomes greater than 2.
Start your spreadsheet program (such as Excel)
Enter Data:
Put the numbers 0, 1, 2, ...,40 into column A.Put
into column B a formula that will compute 2 raised to the power
10 times the value in column A. Put into column C a formula
that will compute 10 raised to the power 3 times the value in
column A.Put into column D a formula that will compute the
ratio of B over C, that is, the ratio of how good or bad the
approximation is.Set the cell format for column
D to display exactly two digits after the decimal point.
Prepare a Chart:
Select the correct range to create a chart that
shows the ratio changing for the 40 rows.Use the chart wizard
("Insert>Chart>Column" or this icon ) to create a graph that
shows the ratio.Move the chart so that is beside your data as
shown in the picture below.
Add an appropriate chart title and remove the "
legend"
Save Worksheet:
In this lab, you will be using a new sheet for
each part, each with its own name. For task1, double-click on
the tab that
says Sheet1
Type the name Power2 in its place.Save the
spreadsheet in a file called lab5_Firstname_Lastname under the
folder COMP152Lab5
Side Note: the spreadsheet application you are using will add
the correct filename extension)
Do this with as little typing and as much use of
Excel's extension feature as possible; you can probably do it by
typing no more
than two or three rows and then extending them. Your table
should look like this when done, except that it will have more
rows, more data in the graph,
and a highlighted row towards the end:
Note: In the example below, numbers are
displayed as "floating point". You do not have to
format that way, most of us prefer more common
looking number formats (comma style?).
No matter what format and number of decimal
places you choose to display - the spreadsheet
software is actually using floating point in the
background to ensure maximum accuracy.
Sample out put
Notice that the approximation gets worse at worse than
linear rate. To see just how
fast it is getting worse, right-click on the bars in the chart,
then select Add
" Trendline" from the Chart menu. Pick the
trendline that gives the best fit to the data.
Task 2: Importing and Sorting Data (20 marks)
It's all well and good to create synthetic data to play with, but
in the real world, one usually works with
real numbers. In this section, you will experiment with data
from Yahoo Finance, which provides a wealth of
financial information in convenient formats. Your task is to
generate a table that displays stock prices and relative
performance for two stocks for the
past two or three months. You can choose any two stocks you
like; interesting pairs might be selected from among Amazon,
Ebay,
Google, Yahoo, IBM, Oracle, Ford, GM, etc. Import DataGo
http://finance.yahoo.com input in the " Search Finance" box
your first stock (such as Amazon).Go to " Historical prices"
(left bar on the screen), set the range of dates that you want,
click on the button " Get Prices" .Go to the bottom of the page
and select "Download To Spreadsheet".Either save the file and
import it into Excel, or open it directly; the latter is
easier.Repeat for your second stock, using the same range of
dates.
Note:
You now have two Excel windows, each displaying
something like the image shown:
Attention:
Move to a new tab in your lab5_Firstname_Lastname
file,
rename the tab to "Stock prices".
Sorting Data
Prepare Data:
In each Excel window, delete all columns
except "Date" and "Adj. Close" and
delete the first row. This should leave exactly two
columns in each Excel windowNow copy/paste the two data
sequences into the "Stock prices" sheet.Since you have two
"Date" columns with the same information,
you can now delete one of them.
Important Note:
After you get rid of the duplicate date column, your
sheet should have three columns and you need to Make sure
column A contains the dates.
Your sheet should have now only three
columns.Change the headings to the corresponding names of
your stock companies.Select all the cells in column A which
contain dates. Change the date format to
a more readable date format (e.g. December 31, 1999)Select all
the numbers in columns B and C format all numbers as "comma
style".
Resize columns if needed.Look through columns B and C to
confirm matching data
(When I did this one stock had a blank row where a dividend
was paid).
If necessary drag price data up if you see a blank. We want to
see at least 60 - 70 rows of data
(working days over 3 months) to a maximum of 250 rows of
data.
Sort Data:
Insert a new column A and insert in it numbers 1, 2 ... etc.The
prices are in most recent first order and you need to reverse
them:Select the three columns (include your headings in row 1),
then on the Data menu,
pick "Sort...", and sort the data by "Date" from oldest to
newest.
Be very careful doing sorting!! If you do it incorrectly you will
create big problems!
At this point, if you select columns B and C, you can compare
the two stocks,
but it won't be very interesting if their prices differ by too
much. So the next step is
to make two new columns that show how the prices have
changed in proportion to the first value.In E2, enter the formula
=C2/C$2. Extend it down to the end of column E. Repeat in F1
for column D, using the formula =D2/D$2.
Attention:
The formula =C2/C$2 is not an error. Normally when
Excel extends formulas it
modifies cell references, using relative values.
The $ in a reference like C$2
tells Excel to leave that cell reference
unchanged ("absolute" instead of relative),
so the subsequent formulas will be =C3/C$2,
=C4/C$2, etc. Thus each cell will contain
the ratio of the price to the initial price.
Sample out put
Task 3: Graphing Data (10 marks)
The next step is to draw a graph of your data. Excel will let you
display data in a lot of different ways, some sensible and some
definitely not.
We want to see two graphs here. One can be a plain vanilla
graph that shows the comparison between the two stocks in a
simple way, like this:.InstructionsUse the chart wizard ("Insert |
Chart" or this icon
to create a graph that looks approximately like the
one above but with a meaningful title, proper labels, etc.Use the
chart wizard to create another graph from exactly the same data
that is as different from the previous one
as you can manage while still displaying the same
information in a form that can potentially be understood. Place
it near the other chart.Make the two charts approximately the
same size and position them so the charts and the numeric data
can all be seen at once.Preview your work. Look at your
worksheet in Print (page) preview.In MS Office, selecting print
preview and page layout lets you scale automatically to print on
one page or perhaps multiple pages but a width of one page.
You must do this operation for each worksheet individually as
different sheets have different printing needs.We are not
printing anything for this assignment but this may be important
later. If you need a printed chart or worksheet
to put in a hard copy assignment or report.
Reminder:
Save the lab5_Firstname_Lastname file in your Lab5
folder and close the file.
Task 4: Functions (10 marks)
Reminder:
Move to a new tab in your lab5_Firstname_Lastname
file, rename the tab to "Coffee".
Create a spreadsheet with the information in the picture below.
InstructionsDisplay in column B the correct description of
the product in column A.Use the vLookup function with
information from "Product Table". Use absolute cell reference
so you can copy the function down. Display in C the cost per
unit (same hints from above) Write a formula in column D to
calculate retail cost. Retail cost is calculated using the
percentage in “Retail markup”.Create an IF function in column
F to calculate total retailUse "Discount" if quantity is greater
than 10In column G write a formula that calculates sales tax
To calculate sales tax use "Tax Rate"
percentageIn column H write a formula to calculate total
(subtotal + taxes)Display the current date in cell B2; format the
cell to a readable date format (eg. December 15, 2013)In my
example, we have only four items to invoice. Add few more
items to invoice.Preview your work and if necessary change the
page layout and fit the sheet content to one printed page.
Attention:
Save and close the file in your lab5 folder
Submission
At this point you should have two spreadsheets in your Lab5
folder. Check through them to make sure they look right.
When everything is working, place a copy of your files into
your lab5 Dropbox in D2LOVERALL ASSESSMENT (10
marks)
Ten marks are set aside for overall assessment. 8 to 10 marks
are given for outstanding work. The assessment proceeds as
follows: 8 - 10 marks given for strong evidence of superior
grasp of spreadsheet concepts. The assignment is completed in
an exemplary manner.4 - 7 marks given for evidence of
reasonable understanding of the spreadsheet concepts. The
assignment is correctly completed. 1- 3 marks given for
evidence of some understanding of spreadsheet concepts. Three
quarters of the assignment is correctly completed.
submit your lab5_Firstname_Lastname file.
NOTE: This assignment is to be done individually. You
can
help one another with problems and questions, but in the
end everyone must
do their own assignment.
CriteriaMarksAll tasksOVERALL ASSESSMENT10Task
1Powers of 2, Powers of 1020Task 2Importing and Sorting Data
20Task 3Graphing Data10Task 4Functions15Total75
Labs/Lab5/lab.css
h1, h2, h3, h4 { color: #3366ff; }
h2 { text-indent: .25em; }
h3 { text-indent: 1.5em; }
h2 small {
font-size: 75%;
font-weight: normal;
color: black;
display: inline;
}
kbd { font-weight: bold; }
aside.note, figure {
float: right;
width: 300px;
margin: 1em;
padding: 10px;
border: 2px solid #ddd;
border-radius: 5px;
background-color: white;
}
figure {
width: 350px;
text-align: center;
margin-top: -10px;
}
aside.info {
margin: .5em 3em;
padding: 20px;
background-color: #eef;
border-radius: 5px;
}
.icon {
background-color: #5d5f60; /* same as Brackets toolbar
background */
border-radius: 3px;
vertical-align: -30%;
}
li.instructions {
margin-bottom: .28em;
}
p {
text-indent: 1em;
}
section {
border-top: 1px solid black;
margin-top: 2em;
}
table {
border-collapse: collapse;
border: 2px solid black;
width: 450px;
table-layout: fixed;
margin: 0 2em;
}
td, th {
border: 1px solid #555;
}
th {
background-color: #ccf;
text-align: left;
padding: 2px 5px;
}
th:nth-child(2), td:last-child {
width:50px;
}
tbody th {
background-color: #eef;
text-indent: 1em;
}
td {
padding: 1px 2px;
}
td:last-child {
text-align: center;
}
tr:last-child td:last-child {
background-color: #ccf;
}
Labs/Lab5/spreadsheets_files/chartwizard.jpg
Labs/Lab5/spreadsheets_files/image006.jpg
Labs/Lab5/spreadsheets_files/image004.png
Labs/Lab5/spreadsheets_files/example.jpg
Labs/Lab5/spreadsheets_files/yahoo1.jpg
Labs/Lab5/spreadsheets_files/power2.jpg
Labs/Lab6/part6.htmlPart 6: Graphics and Sound
Text Links to Other Pages
Very Important: Material on other web sites may be subject to
copyright, and there are both legal and College
restrictions on what you can do with copyrighted material,
including images and sound. The law is evolving in this area
and copyright holders can be very aggressive in asserting their
rights (and sometimes more than their rights).
You should be aware of the College's policy on Copyright.
In part, this says"If you want to use an object or work, which
may include an image, a background pattern, a section of text or
a musical, film, television show, or video selection that you
would like to use, you should make a good faith effort to
determine that such use constitutes a “fair use” under copyright
law or you must obtain permission of the owner or copyright-
holder. As a general matter, you are free to establish links to
Web pages you enjoy and which you would like to share with
others. But you are not generally free to copy or redistribute the
work of others on World Wide Web (or elsewhere) without
authorization and proper attribution."
Accordingly, you should be especially careful of images or
sounds that might be of commercial value to their copyright
owners. If a site has an explicit copyright notice, you should not
copy anything from it. In Canada the new laws related to
copyright give us much more freedom within educational
institutions to use copyrighted material under fair use.
For purposes of this lab, and in creating other web pages, you
should add a citation for each image or sound that you link to or
copy; this is equivalent to citing sources of quotations in a
paper. If there is any ambiguity about whether a sound or image
is copyrighted, use a link, not a local copy.
We won't do video in this lab, but everything here applies to
video clips as well, though the file types will be different.
Adding Graphics
One of the things that distinguishes an eye-catching site from a
mundane one is the clever use of pictures, or graphics. These
graphics can come from many different places -- you might
draw them yourself on the computer, you might upload
photographs, and under some circumstances you can take them
from other web sites.
For now you can use images you've found on the Web, or any
other picture you have on a computer. As long as the filenames
of the pictures you are using end in ".gif", ".jpg" or ".png", the
pictures will be displayable.
First, make a link to an image without copying it onto your
computer:Find an image you like somewhere on the
web.Determine the URL. For example, in Firefox, control-click
or right-click on the image and select "Copy Image Location",
then paste into your document. In Chrome, it's "Copy Image
URL" and it's "Copy Image Address" in Safari.Add an IMG tag
that refers to the image:<IMG SRC="URL">(You can also get
this name with Properties on Firefox.)Add text that cites the
URL from which the image file is being loaded.
Save and view your web page to make sure the picture appears
correctly.
Next, display a picture that you have saved locally, that is, in
your public_htmlimages directory:Create a directory/folder on
your computer and one the server in the public_html directory
called images.Find an image you like somewhere, subject to the
copyright concerns discussed above; or your own pictures are
fine too.Use Control-click or right-click to save the picture in
the images folder in public_html.Type a line like this into your
HTML file to include the image:<IMG
SRC="path/image_filename.jpg">Add text that gives the URL
from which the image file came.
Adding Sound
For now, we will be working with sounds that you find
somewhere on the Web. If you don't have the URLs for any
sounds, use a search engine to locate one. There are also sound
files on Windows and Mac OS X; use Search / Files or Finder to
look for possibilities. Re-read the discussion of copyright above
before you choose a sound file. Do not use any copy of a
popular song, for example. Search in the Creative Commons for
music and pictures for that matter that have a Copy Left license.
Google "music in Creative Commons".
Sound files come in a wide variety of formats, including .WAV
("wave"), .MP3, and .MID. For this lab, please restrict yourself
to WAV, MP3 or MIDI files. Just as the web browser is only
able to display certain kinds of picture files, by default it can
only play sounds from certain kinds of sound files as well. You
will know that you have an appropriate file because the last
three letters of its filename (its extension) will be .WAV or
.MP3 or .MID (or maybe .MIDI).
When you find a sound you like that raises no copyright issues,
use the following instructions to include it in your web
page.Right-click on the link (or use the Download link if there
is one) which leads to the sound file, and save the sound file in
new folder called music in public_html. It's a good idea to keep
your files organized in same type directories.Type either one of
the following lines into your web page to include the sound file
in your web page, where filename.mp3 is the name of the file:
If you want it to be a link, type:<A
HREF="filename.mp3">Here's a sound</A>If you want it to
play automatically, type:<EMBED SRC="filename.mp3">Add
text that gives the URL from which the sound file came.
Using Graphics as Hypertext Links
The final topic for this section is how to use pictures as
hypertext links. You've already seen how to use the <A HREF>
tag to turn text into a hypertext link. But what would happen if,
instead of text, you used those tags to surround a picture?<A
HREF="http://www.tnd.ca"><IMG SRC="suzanne.jpg"></A> or
<A HREF="http://www.camosun.ca"><IMG
SRC="cclogo.gif"></A>
would produce
suzanne.jpg is the name of the file that contains the the photo of
me and cclogo.gif has Camosun college's logo. I originally
downloaded it from the College's web site.
Using an image as a link is exactly the same as using text.
There is something on the web page which the viewer can click
to go to the new location. From the technical viewpoint, there is
no difference between a picture and text except for slightly
different tags.Make one of the images on your page link to some
other page.Place the attribute BORDER="0" inside the IMG tag
to see what happens to your graphic link.Place the attribute
WIDTH="100" inside the IMG tag of one of your larger images
to see what happens to your graphic and link it to the image
itself.
Labs/Lab6/Lab6_SH_1.htmlLab 6_1: Publish, Style, and
ShareLearning Outcomes and IntroductionTask 1: Sharing your
Page with the World Task 2: Create a Site with a Main
PageTask 3: Apply Style Sheet to the main pageSubmission
Learning Outcomes and Introduction
During this lab you will learn how to connect to a server and
upload your material, and perpare your material to be published
on the web.
You will also create a main page to connect all of your
relevant work.
Finally, in this hands on tutorial, we will create a
document with Style sheet rules and link it to our html
documents.Important Reminder
The Linux server that you will be uploading your
files to will accept filenames
that contain spaces or other funny characters, but they
will give you grief;
all filenames should be limited to upper and lower
case letters, digits, period,
underscore and hyphen.
if you have a file name like "A Great
Song.mp3", you should change it
to something like "A_Great_Song.mp3" for
upload.
Also, Linux has a case sensitive file system,
"A_Great_Song.mp3" is not the same as
"a_great_song.mp3".
(Both of these files could exist in Linux at the
same time, but not on a Windows machine).
So...... a folder called "images" is not the same
as "Images"
Task 1: Sharing your Page with the World (15
marks)Instructions
For this task,
you need a file transfer program (FTP) such as
FileZilla.
In the labs you can find it under START >>
Programs >> Computing >>FileZilla.Using the SCP/sFTPclient
log on using
hostname:
studentlabs.cs.camosun.bc.causername: ask me in person or
send me an emailport: 22password: ask me in person or send me
an email and I will let you know what it is (this will give
me a pretty good idea of
when you started on this part of the lab)File Protocol: SCP or
sFTP
After you log on you will see a folder in the right
panel called public_html.
Double click on public_html to enter that
directory. This is where all your web files
should be transferred to when you are done
creating the pages.
Copy your lab4 files and any related images into
your public_html directory.
You should be able to just drag and
drop the files from left to right.
rename Your three Lab4 files into lab4_1,
lab4_2, and lab4_3.To view your web page in a browser, type
into the address bar the following:
http://studentlabs.cs.camosun.bc.ca/~user.name/lab4_1.htm
l
where user.name## is the same as you D2L
username.
NOTE the forward slashes (/) - Linux systems are case
sensitive (so is your username and password).
While working on your web pages,
save your work often on your machine. Transfer the files to the
web server to check your work. IF
YOU FIND ERRORS on your website and want to fix them, fix
them
on your computer and copy them back
to the web server.
You may have to change the permissions on your file to let
people see it.
If your browser tells you that you
don't have permission to access the file,
right click on the file and make sure
the R box is checked.
Task 2: Create a Site with a Main Page..
In this lab you're going to create and edit a file called
index.html that will be stored in the
same public_html folder.public_html and index.html
The name index.html is special because it is the
default
file that your browser will look for if you don't name a specific
one. In other words,
if someone visits
http://studentlabs.cs.camosun.bc.ca/~username, the browser will
automatically
look for index.html because no other file is specified.
Note:
There is an index.html file in your public_html
directory with no code in it. You can either
delete that file or overwrite it when you copy your new version
of index.html from your computer
to the Linux server.
Your index.html file has to be readable by everyone. If
you had trouble with file permissions in
the last lab, (and how would you know that?) ask me for
assistance. I actually don't expect this
problem to show up for any of you.
Remember that any information in your web page is by
default visible to the entire world.
At the least, this strongly suggests that you should not
put anything in your web page
that you would not also publish on the front page of the
National Post.
Instructions Create a title for the page Create appropriate
headings for the content Make sure you have at least a couple of
sub headings: Bio, My Work SampleUsing these tags write two
or three paragraphs about yourself or some fictional person.
It's definitely ok to invent a persona if
you prefer not to publish personal information on the web;
this part is just to use some of the
things that you've learned during lab4 and you can try and use
the tags described in here.
Try and include some escape
codes.Create links to your Lab4_1, lab4_2,and lab4-3 files. If
you need help with the syntax, you can check here. Create a
table with 3 rows and 2 columns insert 3 pictures in the first
column of the table insert the description of the pictures in the
second column create a hyperlink to some of the useful resource
sites such as w3cschools, and wikipedia.
If you need help with the syntax, you can check
here.
Deliverables Save your file as
lab6_1_wo_style_first_last.html
Task 3: Apply Style Sheet to the main page (? marks)
This task is hands on, so you need to make sure that at least
your index.htmlpage is readyInstructionschange
backgroundsytle h1 with background color and font size,sytle
h2 with background color and font size, style the table use
classes, may be even Id ="even" and "odd" to alternate colors
for the tables style images, and resize them - create icon size
image Deliverables Save your file as
lab6_1_w_style_first_last.html
Submission
submit your two files lab6_1_wo_style_first_last.html and
lab6_1_wo_style_first_last.html file
in to the dropbox for lab 6.CriteriaMarksAll tasksTask
1Sharing15Task 2Create main page(index.html)20Task 3First
Style sheet15Total50
Labs/Lab6/part4.htmlPart 4: Links
Text Links to Other Pages
Most often, you will want to link to other sites. The address of a
site is called its URL (Universal Resource Locator).
A URL is a string of text consisting of a domain name like
www.google.com, prefixed by http:// and sometimes
followed by other information, that tells the browser know
where to go. To create a link in a web page, use the A
("anchor") tag and the HREF attribute: <A
HREF="http://URL">Caption for link</A>
Any text that you type between <A HREF...> and </A>will be
displayed in blue and be underlined. For instance, to make a
link to Google, add: <A
HREF="http://www.google.com">Click here for Google!</A>
which will produce Click here for Google!What you write in
HTMLHow it appears on your web page<A
HREF="http://www.google.com">Click here for
Google!</A>Click here for Google!Add two or more links to
sites you like; each link should include some text saying what
the link is.Text links within a page
Sometimes you want to make separate sections of a page
directly accessible, for example to create an index of page
contents with links (like the list of parts at the beginning of this
lab). To do this, you must first mark the target of any links by
creating an anchor. An anchor is an HTML tag that gives a
specific place on your page a name so that it can be referred to
from somewhere else. Anchors use the same <A>tag pair as
regular links. To create an anchor, write <A
NAME="anchorname"></A>
immediately in front of the place you want your link to point to.
For example, the top of this page has an anchor called topbefore
the introduction section. This anchor looks like this: <A
NAME="top"></A>
To link to an anchor, use an HREF with a # and the anchor
name you want to point to, as in the table below. When you
click on the link, the browser will find the "top" anchor and
send you directly there.What you write in HTMLHow it appears
on your web page<A HREF="#top">Click here for the top of
this page.</A>Click here for the top of this page.
Note that the # is included in the HREF link, but not the anchor
NAME itself. You can also link to an anchor in another page;
just add the #name to the end of the link, like this link to the
first lab's section on Unix.Add a link to the bottom of your page
that returns you to the top.
Labs/Lab6/part3.htmlPart 3: Text
Regular Text and Paragraphs
Many web pages, including this one, mostly contain just plain
text. So long as you keep a few important rules in mind,
you can type text into the BODY section of your file, save it,
and that text will be displayed on the web page.
However, there are some key differences. First and foremost is
the fact that line breaks have to be explicitly marked with
the <BR> tag. Besides using <BR> to separate text you can also
use the <P> or paragraph tag,
which not only starts a new line but also puts an empty line
between the two chunks of text it separates. Here's an example:
What you write in HTMLHow it appears on your web pageThe
cat sat
on the
mat.The cat sat on the mat.The cat sat <p> on the mat. The cat
sat
on the mat.
Escape Codes
At this point you might wonder how we manage to display
<BR> and <P> tags in plain text here. It would seem that if we
were to write <BR> in an HTML file, it would insert a break
rather than showing the literal text "<BR>". The secret is to use
"escape codes" to represent certain symbols that have special
meanings in HTML. For example, to display <BR> in an HTML
document you write "&lt;BR&gt;". The escape code &lt; stands
for < ("less than"), &gt; stands for > ("greater than"), and
&amp; stands for & (ampersand).
Note that the semicolon is part of the escape code; if you omit
it, things won't work.
Other symbols, including accented letters like é and ñ and
symbols like ©, are not found on the keyboard and so are
difficult to include. Again, we use escape codes like &eacute;,
&ntilde; and &copy;. One especially useful escape is &nbsp;,
which produces a "non-breakable space", that is, a blank space
that does not go away. You can use it to force a space or to keep
two words together on one line. There's a complete list of
escapes at this site. Finally, you can include any Unicode
character as &#xhhhh;, where hhhh is the hex value, or in
decimal by omitting the x. For instance, &#x05D0; and &#1488;
both produce the Hebrew character alef ‫;א‬.
Headings
To include headings in your web pages, with larger and bolder
text that stands out, use the <H#> </H#> tags. Replace "#" with
a number from 1-6 and surround your heading with these two
tags. The text inside will be bold, usually larger (depending on
the number -- H1 is the largest), and surrounded by empty lines.
What you write in HTMLHow it appears on your web
page<H1>This is an H1 heading.</H1>
<H2>This is an H2
heading.</H2>
<H3>This is an H3 heading.</H3>
<H4>This is an
H4 heading.</H4>
<H5>This is an H5 heading.</H5>
<H6>This is an H6 heading.</H6>This is an H1 heading.
This is an H2 heading.This is an H3 heading.This is an H4
heading.This is an H5 heading.This is an H6 heading.
Always close your header tag (using the appropriate closing tag)
or the rest of your page will be displayed in the larger, bolder
text. The closing tag must match the opening tag: if you open
with <H2>, you must close with </H2>.
Text Style, Size and Color
With a few tags, you can make text bold, italicized, underlined,
bigger, smaller or even a different color.
What you write in HTMLHow it appears on your web
page<B>This tag makes text bold!</B>This tag makes text
bold!<I>This tag italicizes text!</I>This tag italicizes
text!<U>This tag underlines text!</U>This tag underlines
text!<TT>Here's some fixed width text!</TT>Here's some fixed
width text!
To display colored text or change the size of the text, use
<FONT>. The <FONT> tag doesn't do anything by itself, but it
allows you to set the size and color of text through its
attributes. The following table shows how to use the <FONT>
tag.
What you write in HTMLHow it appears on your web
page<FONT COLOR="blue">This is blue text!</FONT>This is
blue text!<FONT SIZE=5>This is big text!</FONT>This is big
text!<FONT COLOR="red" SIZE=6>This is really big red
text!</FONT>This is really big red text!
The color should be one from the table of background colors for
the BODY tag. The size can range from 1-7 with 1 the smallest
and 7 being very, very large. You can also use relative sizes,
like size=-1 and size=+1.
Other Text Tags
Lines: You've probably noticed the horizontal lines that
separate sections of these instructions. You can include such
lines in your page by typing <HR> ("horizontal rule") at each
place where you would like one to appear. Like <BR>, <HR>
does not require a closing tag. The line need not stretch across
the whole page; try <HR width=75%>.
Alignment: To center a heading or a paragraph, use the
<CENTER> </CENTER> tags to surround whatever you would
like to be centered. You can also use the ALIGN=RIGHT or
ALIGN=CENTER attribute with headings and paragraphs, as in
<P ALIGN=CENTER>.
Pre-formatted Text: If you cannot find a way to make your text
appear the way you want, you can always resort to using the
<PRE> </PRE> tags. Any text placed between these two tags
will appear exactly as you type it, including spaces, indentation
and empty lines (though you need escape codes for <, > and &).
But the text will appear in a fixed-width font, will not flow
naturally, and won't wrap at the edge of your window.
Tables: Our tabular displays are created with the <TABLE> tag;
it's one of the topics of the next lab.
Labs/Lab6/lab.css
h1, h2, h3, h4 { color: #3366ff; }
h2 { text-indent: .25em; }
h3 { text-indent: 1.5em; }
h2 small {
font-size: 75%;
font-weight: normal;
color: black;
display: inline;
margin-left: .5em;
}
kbd { font-weight: bold; }
aside.note, figure {
float: right;
width: 300px;
margin: 1em;
padding: 10px;
border: 2px solid #ddd;
border-radius: 5px;
background-color: white;
}
figure {
width: 350px;
text-align: center;
margin-top: -10px;
}
aside.info {
margin: .5em 3em;
padding: 20px;
background-color: #eef;
border-radius: 5px;
}
.icon {
background-color: #5d5f60; /* same as Brackets toolbar
background */
border-radius: 3px;
vertical-align: -30%;
}
li.instructions {
margin-bottom: .28em;
}
p {
text-indent: 1em;
}
section {
border-top: 1px solid black;
margin-top: 2em;
}
table {
border-collapse: collapse;
border: 2px solid black;
width: 450px;
table-layout: fixed;
margin: 0 2em;
}
td, th {
border: 1px solid #555;
}
th {
background-color: #ccf;
text-align: left;
padding: 2px 5px;
}
th:nth-child(2), td:last-child {
width:50px;
}
tbody th {
background-color: #eef;
text-indent: 1em;
}
td {
padding: 1px 2px;
}
td:last-child {
text-align: center;
}
tr:last-child td:last-child {
background-color: #ccf;
}
pre {
background-color: black;
color: white;
border: 2px outset gray;
}
Labs/Lab5/Lab5_Excel_SH.htmlLab 5: SpreadsheetsLearning
Outcomes and IntroductionTask 1: Powers of 2, Powers of 10
Task 2: Importing and Sorting DataTask 3: Graphing DataTask
4: FunctionsSubmission
Learning Outcomes and Introduction
During this process, you will be able to: Demonstrate your
ability to layout and format a spreadsheetDemonstrate the use of
relative vs. absolute references in spreadsheetsDemonstrate the
use of functions in ExcelDemonstrate the use of IF and
VLOOKUP in Excel
Task 1:Powers of 2, Powers of 10 (20 marks)Instructions
There is a reasonably close relationship between
the powers of two and the powers of ten: 210 is a little more
than 103, that is, 1024 is close to 1000. Similarly, 220 is more
than 106
and the ratio is 1.049. The approximation is
pretty good for a long distance though eventually it breaks
down. Your task is to make a spreadsheet that shows
how good the approximation is and find the
place where the ratio first becomes greater than 2.
Start your spreadsheet program (such as Excel)
Enter Data:
Put the numbers 0, 1, 2, ...,40 into column A.Put
into column B a formula that will compute 2 raised to the power
10 times the value in column A. Put into column C a formula
that will compute 10 raised to the power 3 times the value in
column A.Put into column D a formula that will compute the
ratio of B over C, that is, the ratio of how good or bad the
approximation is.Set the cell format for column
D to display exactly two digits after the decimal point.
Prepare a Chart:
Select the correct range to create a chart that
shows the ratio changing for the 40 rows.Use the chart wizard
("Insert>Chart>Column" or this icon ) to create a graph that
shows the ratio.Move the chart so that is beside your data as
shown in the picture below.
Add an appropriate chart title and remove the "
legend"
Save Worksheet:
In this lab, you will be using a new sheet for
each part, each with its own name. For task1, double-click on
the tab that
says Sheet1
Type the name Power2 in its place.Save the
spreadsheet in a file called lab5_Firstname_Lastname under the
folder COMP152Lab5
Side Note: the spreadsheet application you are using will add
the correct filename extension)
Do this with as little typing and as much use of
Excel's extension feature as possible; you can probably do it by
typing no more
than two or three rows and then extending them. Your table
should look like this when done, except that it will have more
rows, more data in the graph,
and a highlighted row towards the end:
Note: In the example below, numbers are
displayed as "floating point". You do not have to
format that way, most of us prefer more common
looking number formats (comma style?).
No matter what format and number of decimal
places you choose to display - the spreadsheet
software is actually using floating point in the
background to ensure maximum accuracy.
Sample out put
Notice that the approximation gets worse at worse than
linear rate. To see just how
fast it is getting worse, right-click on the bars in the chart,
then select Add
" Trendline" from the Chart menu. Pick the
trendline that gives the best fit to the data.
Task 2: Importing and Sorting Data (20 marks)
It's all well and good to create synthetic data to play with, but
in the real world, one usually works with
real numbers. In this section, you will experiment with data
from Yahoo Finance, which provides a wealth of
financial information in convenient formats. Your task is to
generate a table that displays stock prices and relative
performance for two stocks for the
past two or three months. You can choose any two stocks you
like; interesting pairs might be selected from among Amazon,
Ebay,
Google, Yahoo, IBM, Oracle, Ford, GM, etc. Import DataGo
http://finance.yahoo.com input in the " Search Finance" box
your first stock (such as Amazon).Go to " Historical prices"
(left bar on the screen), set the range of dates that you want,
click on the button " Get Prices" .Go to the bottom of the page
and select "Download To Spreadsheet".Either save the file and
import it into Excel, or open it directly; the latter is
easier.Repeat for your second stock, using the same range of
dates.
Note:
You now have two Excel windows, each displaying
something like the image shown:
Attention:
Move to a new tab in your lab5_Firstname_Lastname
file,
rename the tab to "Stock prices".
Sorting Data
Prepare Data:
In each Excel window, delete all columns
except "Date" and "Adj. Close" and
delete the first row. This should leave exactly two
columns in each Excel windowNow copy/paste the two data
sequences into the "Stock prices" sheet.Since you have two
"Date" columns with the same information,
you can now delete one of them.
Important Note:
After you get rid of the duplicate date column, your
sheet should have three columns and you need to Make sure
column A contains the dates.
Your sheet should have now only three
columns.Change the headings to the corresponding names of
your stock companies.Select all the cells in column A which
contain dates. Change the date format to
a more readable date format (e.g. December 31, 1999)Select all
the numbers in columns B and C format all numbers as "comma
style".
Resize columns if needed.Look through columns B and C to
confirm matching data
(When I did this one stock had a blank row where a dividend
was paid).
If necessary drag price data up if you see a blank. We want to
see at least 60 - 70 rows of data
(working days over 3 months) to a maximum of 250 rows of
data.
Sort Data:
Insert a new column A and insert in it numbers 1, 2 ... etc.The
prices are in most recent first order and you need to reverse
them:Select the three columns (include your headings in row 1),
then on the Data menu,
pick "Sort...", and sort the data by "Date" from oldest to
newest.
Be very careful doing sorting!! If you do it incorrectly you will
create big problems!
At this point, if you select columns B and C, you can compare
the two stocks,
but it won't be very interesting if their prices differ by too
much. So the next step is
to make two new columns that show how the prices have
changed in proportion to the first value.In E2, enter the formula
=C2/C$2. Extend it down to the end of column E. Repeat in F1
for column D, using the formula =D2/D$2.
Attention:
The formula =C2/C$2 is not an error. Normally when
Excel extends formulas it
modifies cell references, using relative values.
The $ in a reference like C$2
tells Excel to leave that cell reference
unchanged ("absolute" instead of relative),
so the subsequent formulas will be =C3/C$2,
=C4/C$2, etc. Thus each cell will contain
the ratio of the price to the initial price.
Sample out put
Task 3: Graphing Data (10 marks)
The next step is to draw a graph of your data. Excel will let you
display data in a lot of different ways, some sensible and some
definitely not.
We want to see two graphs here. One can be a plain vanilla
graph that shows the comparison between the two stocks in a
simple way, like this:.InstructionsUse the chart wizard ("Insert |
Chart" or this icon
to create a graph that looks approximately like the
one above but with a meaningful title, proper labels, etc.Use the
chart wizard to create another graph from exactly the same data
that is as different from the previous one
as you can manage while still displaying the same
information in a form that can potentially be understood. Place
it near the other chart.Make the two charts approximately the
same size and position them so the charts and the numeric data
can all be seen at once.Preview your work. Look at your
worksheet in Print (page) preview.In MS Office, selecting print
preview and page layout lets you scale automatically to print on
one page or perhaps multiple pages but a width of one page.
You must do this operation for each worksheet individually as
different sheets have different printing needs.We are not
printing anything for this assignment but this may be important
later. If you need a printed chart or worksheet
to put in a hard copy assignment or report.
Reminder:
Save the lab5_Firstname_Lastname file in your Lab5
folder and close the file.
Task 4: Functions (10 marks)
Reminder:
Move to a new tab in your lab5_Firstname_Lastname
file, rename the tab to "Coffee".
Create a spreadsheet with the information in the picture below.
InstructionsDisplay in column B the correct description of
the product in column A.Use the vLookup function with
information from "Product Table". Use absolute cell reference
so you can copy the function down. Display in C the cost per
unit (same hints from above) Write a formula in column D to
calculate retail cost. Retail cost is calculated using the
percentage in “Retail markup”.Create an IF function in column
F to calculate total retailUse "Discount" if quantity is greater
than 10In column G write a formula that calculates sales tax
To calculate sales tax use "Tax Rate"
percentageIn column H write a formula to calculate total
(subtotal + taxes)Display the current date in cell B2; format the
cell to a readable date format (eg. December 15, 2013)In my
example, we have only four items to invoice. Add few more
items to invoice.Preview your work and if necessary change the
page layout and fit the sheet content to one printed page.
Attention:
Save and close the file in your lab5 folder
Submission
At this point you should have two spreadsheets in your Lab5
folder. Check through them to make sure they look right.
When everything is working, place a copy of your files into
your lab5 Dropbox in D2LOVERALL ASSESSMENT (10
marks)
Ten marks are set aside for overall assessment. 8 to 10 marks
are given for outstanding work. The assessment proceeds as
follows: 8 - 10 marks given for strong evidence of superior
grasp of spreadsheet concepts. The assignment is completed in
an exemplary manner.4 - 7 marks given for evidence of
reasonable understanding of the spreadsheet concepts. The
assignment is correctly completed. 1- 3 marks given for
evidence of some understanding of spreadsheet concepts. Three
quarters of the assignment is correctly completed.
submit your lab5_Firstname_Lastname file.
NOTE: This assignment is to be done individually. You
can
help one another with problems and questions, but in the
end everyone must
do their own assignment.
CriteriaMarksAll tasksOVERALL ASSESSMENT10Task
1Powers of 2, Powers of 1020Task 2Importing and Sorting Data
20Task 3Graphing Data10Task 4Functions15Total75
Labs/Lab5/lab.css
h1, h2, h3, h4 { color: #3366ff; }
h2 { text-indent: .25em; }
h3 { text-indent: 1.5em; }
h2 small {
font-size: 75%;
font-weight: normal;
color: black;
display: inline;
}
kbd { font-weight: bold; }
aside.note, figure {
float: right;
width: 300px;
margin: 1em;
padding: 10px;
border: 2px solid #ddd;
border-radius: 5px;
background-color: white;
}
figure {
width: 350px;
text-align: center;
margin-top: -10px;
}
aside.info {
margin: .5em 3em;
padding: 20px;
background-color: #eef;
border-radius: 5px;
}
.icon {
background-color: #5d5f60; /* same as Brackets toolbar
background */
border-radius: 3px;
vertical-align: -30%;
}
li.instructions {
margin-bottom: .28em;
}
p {
text-indent: 1em;
}
section {
border-top: 1px solid black;
margin-top: 2em;
}
table {
border-collapse: collapse;
border: 2px solid black;
width: 450px;
table-layout: fixed;
margin: 0 2em;
}
td, th {
border: 1px solid #555;
}
th {
background-color: #ccf;
text-align: left;
padding: 2px 5px;
}
th:nth-child(2), td:last-child {
width:50px;
}
tbody th {
background-color: #eef;
text-indent: 1em;
}
td {
padding: 1px 2px;
}
td:last-child {
text-align: center;
}
tr:last-child td:last-child {
background-color: #ccf;
}
Labs/Lab5/spreadsheets_files/chartwizard.jpg
Labs/Lab5/spreadsheets_files/image006.jpg
Labs/Lab5/spreadsheets_files/image004.png
Labs/Lab5/spreadsheets_files/example.jpg
Labs/Lab5/spreadsheets_files/yahoo1.jpg
Labs/Lab5/spreadsheets_files/power2.jpg

More Related Content

DOCX
Itm310 problem solving #7 complete solutions correct answers key
DOCX
In Section 1 on the Data page, complete each column of the spreads.docx
PPS
Advanced excel unit 01
PDF
Excel booklet
PPT
Tech training workshop 3 final 090810
DOCX
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
DOCX
1 Mashing Up Data with PowerPivot When Filter, .docx
PPTX
Empowerment Technologies.pptx explore the world of technologies
Itm310 problem solving #7 complete solutions correct answers key
In Section 1 on the Data page, complete each column of the spreads.docx
Advanced excel unit 01
Excel booklet
Tech training workshop 3 final 090810
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
1 Mashing Up Data with PowerPivot When Filter, .docx
Empowerment Technologies.pptx explore the world of technologies

Similar to LabsLab5Lab5_Excel_SH.htmlLab 5 SpreadsheetsLearning Outcomes.docx (20)

PDF
Excel Slope Instruction
PPT
Dervy bis-155-final-exam-guide-music-on-demand-new
PPT
Devry bis-155-final-exam-guide-new
PPT
Introduction to micro soft Training ms Excel.ppt
DOC
Devry bis 155 final exam guide (music on demand) new
DOC
Dervy bis 155 final exam guide music on demand new
PDF
Excel notes by satish kumar avunoori
DOC
IFSM 201 Possible Is Everything/newtonhelp.com
DOC
IFSM 201 Learn/newtonhelp.com
PPTX
G10 Unit 4.pptx
PDF
IGCSE ICT (0417/0983) - Spreadsheets - Ajiro Tech
PPT
Microsoft Excel Training
DOCX
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
DOCX
Excel Project 2 Check FiguresSteps 1-2-3 As instructedStep
PPTX
Basic Ms excel
PPTX
Microsoft Excel.pptx
DOCX
How to create pivot table in excel
PDF
Pivot-Table-Handout1-projectcubicle lecture notes
PDF
CAP Excel Formulas & Functions July - Copy (4).pdf
DOCX
ACTG Tableau intro labDownload the TableauLab file and look ov.docx
Excel Slope Instruction
Dervy bis-155-final-exam-guide-music-on-demand-new
Devry bis-155-final-exam-guide-new
Introduction to micro soft Training ms Excel.ppt
Devry bis 155 final exam guide (music on demand) new
Dervy bis 155 final exam guide music on demand new
Excel notes by satish kumar avunoori
IFSM 201 Possible Is Everything/newtonhelp.com
IFSM 201 Learn/newtonhelp.com
G10 Unit 4.pptx
IGCSE ICT (0417/0983) - Spreadsheets - Ajiro Tech
Microsoft Excel Training
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Excel Project 2 Check FiguresSteps 1-2-3 As instructedStep
Basic Ms excel
Microsoft Excel.pptx
How to create pivot table in excel
Pivot-Table-Handout1-projectcubicle lecture notes
CAP Excel Formulas & Functions July - Copy (4).pdf
ACTG Tableau intro labDownload the TableauLab file and look ov.docx
Ad

More from DIPESH30 (20)

DOCX
please write a short essay to address the following questions. Lengt.docx
DOCX
please write a diary entry from the perspective of a French Revoluti.docx
DOCX
Please write the definition for these words and provide .docx
DOCX
Please view the filmThomas A. Edison Father of Invention, A .docx
DOCX
Please watch the clip from the movie The Break Up.  Then reflect w.docx
DOCX
please write a report on Social Media and ERP SystemReport should.docx
DOCX
Please write 200 wordsHow has the healthcare delivery system chang.docx
DOCX
Please view the documentary on Typhoid Mary at httpswww..docx
DOCX
Please use the two attachments posted to complete work.  Detailed in.docx
DOCX
Please use the sources in the outline (see photos)The research.docx
DOCX
Please submit a minimum of five (5) detailed and discussion-provokin.docx
DOCX
Please think about the various learning activities you engaged in du.docx
DOCX
Please type out the question and answer it underneath. Each question.docx
DOCX
Please use the following technique-Outline the legal issues t.docx
DOCX
Please use from these stratagies This homework will be to copyies .docx
DOCX
PLEASE THOROUGHLY ANSWER THE FOLLOWING FIVE QUESTIONS BELOW IN.docx
DOCX
Please share your thoughts about how well your employer, military .docx
DOCX
Please select and answer one of the following topics in a well-org.docx
DOCX
Please see the attachment for the actual work that is require.  This.docx
DOCX
Please see the attachment and look over the LOOK HERE FIRST file b.docx
please write a short essay to address the following questions. Lengt.docx
please write a diary entry from the perspective of a French Revoluti.docx
Please write the definition for these words and provide .docx
Please view the filmThomas A. Edison Father of Invention, A .docx
Please watch the clip from the movie The Break Up.  Then reflect w.docx
please write a report on Social Media and ERP SystemReport should.docx
Please write 200 wordsHow has the healthcare delivery system chang.docx
Please view the documentary on Typhoid Mary at httpswww..docx
Please use the two attachments posted to complete work.  Detailed in.docx
Please use the sources in the outline (see photos)The research.docx
Please submit a minimum of five (5) detailed and discussion-provokin.docx
Please think about the various learning activities you engaged in du.docx
Please type out the question and answer it underneath. Each question.docx
Please use the following technique-Outline the legal issues t.docx
Please use from these stratagies This homework will be to copyies .docx
PLEASE THOROUGHLY ANSWER THE FOLLOWING FIVE QUESTIONS BELOW IN.docx
Please share your thoughts about how well your employer, military .docx
Please select and answer one of the following topics in a well-org.docx
Please see the attachment for the actual work that is require.  This.docx
Please see the attachment and look over the LOOK HERE FIRST file b.docx
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Sports Quiz easy sports quiz sports quiz
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Cell Structure & Organelles in detailed.
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Complications of Minimal Access Surgery at WLH
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Abdominal Access Techniques with Prof. Dr. R K Mishra
Sports Quiz easy sports quiz sports quiz
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O7-L3 Supply Chain Operations - ICLT Program
Cell Structure & Organelles in detailed.
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Institutional Correction lecture only . . .
Renaissance Architecture: A Journey from Faith to Humanism
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Complications of Minimal Access Surgery at WLH
102 student loan defaulters named and shamed – Is someone you know on the list?
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

LabsLab5Lab5_Excel_SH.htmlLab 5 SpreadsheetsLearning Outcomes.docx

  • 1. Labs/Lab5/Lab5_Excel_SH.htmlLab 5: SpreadsheetsLearning Outcomes and IntroductionTask 1: Powers of 2, Powers of 10 Task 2: Importing and Sorting DataTask 3: Graphing DataTask 4: FunctionsSubmission Learning Outcomes and Introduction During this process, you will be able to: Demonstrate your ability to layout and format a spreadsheetDemonstrate the use of relative vs. absolute references in spreadsheetsDemonstrate the use of functions in ExcelDemonstrate the use of IF and VLOOKUP in Excel Task 1:Powers of 2, Powers of 10 (20 marks)Instructions There is a reasonably close relationship between the powers of two and the powers of ten: 210 is a little more than 103, that is, 1024 is close to 1000. Similarly, 220 is more than 106 and the ratio is 1.049. The approximation is pretty good for a long distance though eventually it breaks down. Your task is to make a spreadsheet that shows how good the approximation is and find the place where the ratio first becomes greater than 2. Start your spreadsheet program (such as Excel) Enter Data: Put the numbers 0, 1, 2, ...,40 into column A.Put into column B a formula that will compute 2 raised to the power 10 times the value in column A. Put into column C a formula that will compute 10 raised to the power 3 times the value in
  • 2. column A.Put into column D a formula that will compute the ratio of B over C, that is, the ratio of how good or bad the approximation is.Set the cell format for column D to display exactly two digits after the decimal point. Prepare a Chart: Select the correct range to create a chart that shows the ratio changing for the 40 rows.Use the chart wizard ("Insert>Chart>Column" or this icon ) to create a graph that shows the ratio.Move the chart so that is beside your data as shown in the picture below. Add an appropriate chart title and remove the " legend" Save Worksheet: In this lab, you will be using a new sheet for each part, each with its own name. For task1, double-click on the tab that says Sheet1 Type the name Power2 in its place.Save the spreadsheet in a file called lab5_Firstname_Lastname under the folder COMP152Lab5 Side Note: the spreadsheet application you are using will add the correct filename extension) Do this with as little typing and as much use of Excel's extension feature as possible; you can probably do it by typing no more than two or three rows and then extending them. Your table should look like this when done, except that it will have more rows, more data in the graph,
  • 3. and a highlighted row towards the end: Note: In the example below, numbers are displayed as "floating point". You do not have to format that way, most of us prefer more common looking number formats (comma style?). No matter what format and number of decimal places you choose to display - the spreadsheet software is actually using floating point in the background to ensure maximum accuracy. Sample out put Notice that the approximation gets worse at worse than linear rate. To see just how fast it is getting worse, right-click on the bars in the chart, then select Add " Trendline" from the Chart menu. Pick the trendline that gives the best fit to the data. Task 2: Importing and Sorting Data (20 marks) It's all well and good to create synthetic data to play with, but in the real world, one usually works with real numbers. In this section, you will experiment with data from Yahoo Finance, which provides a wealth of financial information in convenient formats. Your task is to generate a table that displays stock prices and relative performance for two stocks for the
  • 4. past two or three months. You can choose any two stocks you like; interesting pairs might be selected from among Amazon, Ebay, Google, Yahoo, IBM, Oracle, Ford, GM, etc. Import DataGo http://finance.yahoo.com input in the " Search Finance" box your first stock (such as Amazon).Go to " Historical prices" (left bar on the screen), set the range of dates that you want, click on the button " Get Prices" .Go to the bottom of the page and select "Download To Spreadsheet".Either save the file and import it into Excel, or open it directly; the latter is easier.Repeat for your second stock, using the same range of dates. Note: You now have two Excel windows, each displaying something like the image shown: Attention: Move to a new tab in your lab5_Firstname_Lastname file, rename the tab to "Stock prices". Sorting Data Prepare Data: In each Excel window, delete all columns except "Date" and "Adj. Close" and delete the first row. This should leave exactly two columns in each Excel windowNow copy/paste the two data sequences into the "Stock prices" sheet.Since you have two "Date" columns with the same information, you can now delete one of them.
  • 5. Important Note: After you get rid of the duplicate date column, your sheet should have three columns and you need to Make sure column A contains the dates. Your sheet should have now only three columns.Change the headings to the corresponding names of your stock companies.Select all the cells in column A which contain dates. Change the date format to a more readable date format (e.g. December 31, 1999)Select all the numbers in columns B and C format all numbers as "comma style". Resize columns if needed.Look through columns B and C to confirm matching data (When I did this one stock had a blank row where a dividend was paid). If necessary drag price data up if you see a blank. We want to see at least 60 - 70 rows of data (working days over 3 months) to a maximum of 250 rows of data. Sort Data: Insert a new column A and insert in it numbers 1, 2 ... etc.The prices are in most recent first order and you need to reverse them:Select the three columns (include your headings in row 1), then on the Data menu, pick "Sort...", and sort the data by "Date" from oldest to newest. Be very careful doing sorting!! If you do it incorrectly you will create big problems! At this point, if you select columns B and C, you can compare the two stocks, but it won't be very interesting if their prices differ by too much. So the next step is to make two new columns that show how the prices have
  • 6. changed in proportion to the first value.In E2, enter the formula =C2/C$2. Extend it down to the end of column E. Repeat in F1 for column D, using the formula =D2/D$2. Attention: The formula =C2/C$2 is not an error. Normally when Excel extends formulas it modifies cell references, using relative values. The $ in a reference like C$2 tells Excel to leave that cell reference unchanged ("absolute" instead of relative), so the subsequent formulas will be =C3/C$2, =C4/C$2, etc. Thus each cell will contain the ratio of the price to the initial price. Sample out put Task 3: Graphing Data (10 marks) The next step is to draw a graph of your data. Excel will let you display data in a lot of different ways, some sensible and some definitely not. We want to see two graphs here. One can be a plain vanilla graph that shows the comparison between the two stocks in a simple way, like this:.InstructionsUse the chart wizard ("Insert | Chart" or this icon to create a graph that looks approximately like the one above but with a meaningful title, proper labels, etc.Use the chart wizard to create another graph from exactly the same data that is as different from the previous one as you can manage while still displaying the same information in a form that can potentially be understood. Place it near the other chart.Make the two charts approximately the same size and position them so the charts and the numeric data can all be seen at once.Preview your work. Look at your
  • 7. worksheet in Print (page) preview.In MS Office, selecting print preview and page layout lets you scale automatically to print on one page or perhaps multiple pages but a width of one page. You must do this operation for each worksheet individually as different sheets have different printing needs.We are not printing anything for this assignment but this may be important later. If you need a printed chart or worksheet to put in a hard copy assignment or report. Reminder: Save the lab5_Firstname_Lastname file in your Lab5 folder and close the file. Task 4: Functions (10 marks) Reminder: Move to a new tab in your lab5_Firstname_Lastname file, rename the tab to "Coffee". Create a spreadsheet with the information in the picture below. InstructionsDisplay in column B the correct description of the product in column A.Use the vLookup function with information from "Product Table". Use absolute cell reference so you can copy the function down. Display in C the cost per unit (same hints from above) Write a formula in column D to calculate retail cost. Retail cost is calculated using the percentage in “Retail markup”.Create an IF function in column F to calculate total retailUse "Discount" if quantity is greater than 10In column G write a formula that calculates sales tax
  • 8. To calculate sales tax use "Tax Rate" percentageIn column H write a formula to calculate total (subtotal + taxes)Display the current date in cell B2; format the cell to a readable date format (eg. December 15, 2013)In my example, we have only four items to invoice. Add few more items to invoice.Preview your work and if necessary change the page layout and fit the sheet content to one printed page. Attention: Save and close the file in your lab5 folder Submission At this point you should have two spreadsheets in your Lab5 folder. Check through them to make sure they look right. When everything is working, place a copy of your files into your lab5 Dropbox in D2LOVERALL ASSESSMENT (10 marks) Ten marks are set aside for overall assessment. 8 to 10 marks are given for outstanding work. The assessment proceeds as follows: 8 - 10 marks given for strong evidence of superior grasp of spreadsheet concepts. The assignment is completed in an exemplary manner.4 - 7 marks given for evidence of reasonable understanding of the spreadsheet concepts. The assignment is correctly completed. 1- 3 marks given for evidence of some understanding of spreadsheet concepts. Three quarters of the assignment is correctly completed. submit your lab5_Firstname_Lastname file. NOTE: This assignment is to be done individually. You can help one another with problems and questions, but in the
  • 9. end everyone must do their own assignment. CriteriaMarksAll tasksOVERALL ASSESSMENT10Task 1Powers of 2, Powers of 1020Task 2Importing and Sorting Data 20Task 3Graphing Data10Task 4Functions15Total75 Labs/Lab5/lab.css h1, h2, h3, h4 { color: #3366ff; } h2 { text-indent: .25em; } h3 { text-indent: 1.5em; } h2 small { font-size: 75%; font-weight: normal; color: black; display: inline; } kbd { font-weight: bold; } aside.note, figure { float: right; width: 300px; margin: 1em; padding: 10px; border: 2px solid #ddd; border-radius: 5px; background-color: white; } figure { width: 350px; text-align: center; margin-top: -10px; } aside.info { margin: .5em 3em; padding: 20px; background-color: #eef; border-radius: 5px;
  • 10. } .icon { background-color: #5d5f60; /* same as Brackets toolbar background */ border-radius: 3px; vertical-align: -30%; } li.instructions { margin-bottom: .28em; } p { text-indent: 1em; } section { border-top: 1px solid black; margin-top: 2em; } table { border-collapse: collapse; border: 2px solid black; width: 450px; table-layout: fixed; margin: 0 2em; } td, th { border: 1px solid #555; } th { background-color: #ccf; text-align: left; padding: 2px 5px; } th:nth-child(2), td:last-child {
  • 11. width:50px; } tbody th { background-color: #eef; text-indent: 1em; } td { padding: 1px 2px; } td:last-child { text-align: center; } tr:last-child td:last-child { background-color: #ccf; } Labs/Lab5/spreadsheets_files/chartwizard.jpg Labs/Lab5/spreadsheets_files/image006.jpg Labs/Lab5/spreadsheets_files/image004.png Labs/Lab5/spreadsheets_files/example.jpg Labs/Lab5/spreadsheets_files/yahoo1.jpg Labs/Lab5/spreadsheets_files/power2.jpg Labs/Lab6/part6.htmlPart 6: Graphics and Sound Text Links to Other Pages Very Important: Material on other web sites may be subject to copyright, and there are both legal and College restrictions on what you can do with copyrighted material, including images and sound. The law is evolving in this area
  • 12. and copyright holders can be very aggressive in asserting their rights (and sometimes more than their rights). You should be aware of the College's policy on Copyright. In part, this says"If you want to use an object or work, which may include an image, a background pattern, a section of text or a musical, film, television show, or video selection that you would like to use, you should make a good faith effort to determine that such use constitutes a “fair use” under copyright law or you must obtain permission of the owner or copyright- holder. As a general matter, you are free to establish links to Web pages you enjoy and which you would like to share with others. But you are not generally free to copy or redistribute the work of others on World Wide Web (or elsewhere) without authorization and proper attribution." Accordingly, you should be especially careful of images or sounds that might be of commercial value to their copyright owners. If a site has an explicit copyright notice, you should not copy anything from it. In Canada the new laws related to copyright give us much more freedom within educational institutions to use copyrighted material under fair use. For purposes of this lab, and in creating other web pages, you should add a citation for each image or sound that you link to or copy; this is equivalent to citing sources of quotations in a paper. If there is any ambiguity about whether a sound or image is copyrighted, use a link, not a local copy. We won't do video in this lab, but everything here applies to video clips as well, though the file types will be different. Adding Graphics One of the things that distinguishes an eye-catching site from a mundane one is the clever use of pictures, or graphics. These graphics can come from many different places -- you might draw them yourself on the computer, you might upload photographs, and under some circumstances you can take them from other web sites.
  • 13. For now you can use images you've found on the Web, or any other picture you have on a computer. As long as the filenames of the pictures you are using end in ".gif", ".jpg" or ".png", the pictures will be displayable. First, make a link to an image without copying it onto your computer:Find an image you like somewhere on the web.Determine the URL. For example, in Firefox, control-click or right-click on the image and select "Copy Image Location", then paste into your document. In Chrome, it's "Copy Image URL" and it's "Copy Image Address" in Safari.Add an IMG tag that refers to the image:<IMG SRC="URL">(You can also get this name with Properties on Firefox.)Add text that cites the URL from which the image file is being loaded. Save and view your web page to make sure the picture appears correctly. Next, display a picture that you have saved locally, that is, in your public_htmlimages directory:Create a directory/folder on your computer and one the server in the public_html directory called images.Find an image you like somewhere, subject to the copyright concerns discussed above; or your own pictures are fine too.Use Control-click or right-click to save the picture in the images folder in public_html.Type a line like this into your HTML file to include the image:<IMG SRC="path/image_filename.jpg">Add text that gives the URL from which the image file came. Adding Sound For now, we will be working with sounds that you find somewhere on the Web. If you don't have the URLs for any sounds, use a search engine to locate one. There are also sound files on Windows and Mac OS X; use Search / Files or Finder to look for possibilities. Re-read the discussion of copyright above before you choose a sound file. Do not use any copy of a popular song, for example. Search in the Creative Commons for music and pictures for that matter that have a Copy Left license. Google "music in Creative Commons".
  • 14. Sound files come in a wide variety of formats, including .WAV ("wave"), .MP3, and .MID. For this lab, please restrict yourself to WAV, MP3 or MIDI files. Just as the web browser is only able to display certain kinds of picture files, by default it can only play sounds from certain kinds of sound files as well. You will know that you have an appropriate file because the last three letters of its filename (its extension) will be .WAV or .MP3 or .MID (or maybe .MIDI). When you find a sound you like that raises no copyright issues, use the following instructions to include it in your web page.Right-click on the link (or use the Download link if there is one) which leads to the sound file, and save the sound file in new folder called music in public_html. It's a good idea to keep your files organized in same type directories.Type either one of the following lines into your web page to include the sound file in your web page, where filename.mp3 is the name of the file: If you want it to be a link, type:<A HREF="filename.mp3">Here's a sound</A>If you want it to play automatically, type:<EMBED SRC="filename.mp3">Add text that gives the URL from which the sound file came. Using Graphics as Hypertext Links The final topic for this section is how to use pictures as hypertext links. You've already seen how to use the <A HREF> tag to turn text into a hypertext link. But what would happen if, instead of text, you used those tags to surround a picture?<A HREF="http://www.tnd.ca"><IMG SRC="suzanne.jpg"></A> or <A HREF="http://www.camosun.ca"><IMG SRC="cclogo.gif"></A> would produce suzanne.jpg is the name of the file that contains the the photo of me and cclogo.gif has Camosun college's logo. I originally downloaded it from the College's web site. Using an image as a link is exactly the same as using text.
  • 15. There is something on the web page which the viewer can click to go to the new location. From the technical viewpoint, there is no difference between a picture and text except for slightly different tags.Make one of the images on your page link to some other page.Place the attribute BORDER="0" inside the IMG tag to see what happens to your graphic link.Place the attribute WIDTH="100" inside the IMG tag of one of your larger images to see what happens to your graphic and link it to the image itself. Labs/Lab6/Lab6_SH_1.htmlLab 6_1: Publish, Style, and ShareLearning Outcomes and IntroductionTask 1: Sharing your Page with the World Task 2: Create a Site with a Main PageTask 3: Apply Style Sheet to the main pageSubmission Learning Outcomes and Introduction During this lab you will learn how to connect to a server and upload your material, and perpare your material to be published on the web. You will also create a main page to connect all of your relevant work. Finally, in this hands on tutorial, we will create a document with Style sheet rules and link it to our html documents.Important Reminder The Linux server that you will be uploading your files to will accept filenames that contain spaces or other funny characters, but they will give you grief; all filenames should be limited to upper and lower case letters, digits, period, underscore and hyphen. if you have a file name like "A Great Song.mp3", you should change it
  • 16. to something like "A_Great_Song.mp3" for upload. Also, Linux has a case sensitive file system, "A_Great_Song.mp3" is not the same as "a_great_song.mp3". (Both of these files could exist in Linux at the same time, but not on a Windows machine). So...... a folder called "images" is not the same as "Images" Task 1: Sharing your Page with the World (15 marks)Instructions For this task, you need a file transfer program (FTP) such as FileZilla. In the labs you can find it under START >> Programs >> Computing >>FileZilla.Using the SCP/sFTPclient log on using hostname: studentlabs.cs.camosun.bc.causername: ask me in person or send me an emailport: 22password: ask me in person or send me an email and I will let you know what it is (this will give me a pretty good idea of when you started on this part of the lab)File Protocol: SCP or sFTP After you log on you will see a folder in the right panel called public_html. Double click on public_html to enter that directory. This is where all your web files should be transferred to when you are done
  • 17. creating the pages. Copy your lab4 files and any related images into your public_html directory. You should be able to just drag and drop the files from left to right. rename Your three Lab4 files into lab4_1, lab4_2, and lab4_3.To view your web page in a browser, type into the address bar the following: http://studentlabs.cs.camosun.bc.ca/~user.name/lab4_1.htm l where user.name## is the same as you D2L username. NOTE the forward slashes (/) - Linux systems are case sensitive (so is your username and password). While working on your web pages, save your work often on your machine. Transfer the files to the web server to check your work. IF YOU FIND ERRORS on your website and want to fix them, fix them on your computer and copy them back to the web server. You may have to change the permissions on your file to let people see it. If your browser tells you that you don't have permission to access the file, right click on the file and make sure the R box is checked. Task 2: Create a Site with a Main Page.. In this lab you're going to create and edit a file called index.html that will be stored in the same public_html folder.public_html and index.html
  • 18. The name index.html is special because it is the default file that your browser will look for if you don't name a specific one. In other words, if someone visits http://studentlabs.cs.camosun.bc.ca/~username, the browser will automatically look for index.html because no other file is specified. Note: There is an index.html file in your public_html directory with no code in it. You can either delete that file or overwrite it when you copy your new version of index.html from your computer to the Linux server. Your index.html file has to be readable by everyone. If you had trouble with file permissions in the last lab, (and how would you know that?) ask me for assistance. I actually don't expect this problem to show up for any of you. Remember that any information in your web page is by default visible to the entire world. At the least, this strongly suggests that you should not put anything in your web page that you would not also publish on the front page of the
  • 19. National Post. Instructions Create a title for the page Create appropriate headings for the content Make sure you have at least a couple of sub headings: Bio, My Work SampleUsing these tags write two or three paragraphs about yourself or some fictional person. It's definitely ok to invent a persona if you prefer not to publish personal information on the web; this part is just to use some of the things that you've learned during lab4 and you can try and use the tags described in here. Try and include some escape codes.Create links to your Lab4_1, lab4_2,and lab4-3 files. If you need help with the syntax, you can check here. Create a table with 3 rows and 2 columns insert 3 pictures in the first column of the table insert the description of the pictures in the second column create a hyperlink to some of the useful resource sites such as w3cschools, and wikipedia. If you need help with the syntax, you can check here. Deliverables Save your file as lab6_1_wo_style_first_last.html Task 3: Apply Style Sheet to the main page (? marks) This task is hands on, so you need to make sure that at least your index.htmlpage is readyInstructionschange backgroundsytle h1 with background color and font size,sytle h2 with background color and font size, style the table use classes, may be even Id ="even" and "odd" to alternate colors for the tables style images, and resize them - create icon size image Deliverables Save your file as lab6_1_w_style_first_last.html Submission
  • 20. submit your two files lab6_1_wo_style_first_last.html and lab6_1_wo_style_first_last.html file in to the dropbox for lab 6.CriteriaMarksAll tasksTask 1Sharing15Task 2Create main page(index.html)20Task 3First Style sheet15Total50 Labs/Lab6/part4.htmlPart 4: Links Text Links to Other Pages Most often, you will want to link to other sites. The address of a site is called its URL (Universal Resource Locator). A URL is a string of text consisting of a domain name like www.google.com, prefixed by http:// and sometimes followed by other information, that tells the browser know where to go. To create a link in a web page, use the A ("anchor") tag and the HREF attribute: <A HREF="http://URL">Caption for link</A> Any text that you type between <A HREF...> and </A>will be displayed in blue and be underlined. For instance, to make a link to Google, add: <A HREF="http://www.google.com">Click here for Google!</A> which will produce Click here for Google!What you write in HTMLHow it appears on your web page<A HREF="http://www.google.com">Click here for Google!</A>Click here for Google!Add two or more links to sites you like; each link should include some text saying what the link is.Text links within a page Sometimes you want to make separate sections of a page directly accessible, for example to create an index of page contents with links (like the list of parts at the beginning of this lab). To do this, you must first mark the target of any links by creating an anchor. An anchor is an HTML tag that gives a specific place on your page a name so that it can be referred to from somewhere else. Anchors use the same <A>tag pair as regular links. To create an anchor, write <A NAME="anchorname"></A>
  • 21. immediately in front of the place you want your link to point to. For example, the top of this page has an anchor called topbefore the introduction section. This anchor looks like this: <A NAME="top"></A> To link to an anchor, use an HREF with a # and the anchor name you want to point to, as in the table below. When you click on the link, the browser will find the "top" anchor and send you directly there.What you write in HTMLHow it appears on your web page<A HREF="#top">Click here for the top of this page.</A>Click here for the top of this page. Note that the # is included in the HREF link, but not the anchor NAME itself. You can also link to an anchor in another page; just add the #name to the end of the link, like this link to the first lab's section on Unix.Add a link to the bottom of your page that returns you to the top. Labs/Lab6/part3.htmlPart 3: Text Regular Text and Paragraphs Many web pages, including this one, mostly contain just plain text. So long as you keep a few important rules in mind, you can type text into the BODY section of your file, save it, and that text will be displayed on the web page. However, there are some key differences. First and foremost is the fact that line breaks have to be explicitly marked with the <BR> tag. Besides using <BR> to separate text you can also use the <P> or paragraph tag, which not only starts a new line but also puts an empty line between the two chunks of text it separates. Here's an example: What you write in HTMLHow it appears on your web pageThe cat sat on the mat.The cat sat on the mat.The cat sat <p> on the mat. The cat sat
  • 22. on the mat. Escape Codes At this point you might wonder how we manage to display <BR> and <P> tags in plain text here. It would seem that if we were to write <BR> in an HTML file, it would insert a break rather than showing the literal text "<BR>". The secret is to use "escape codes" to represent certain symbols that have special meanings in HTML. For example, to display <BR> in an HTML document you write "&lt;BR&gt;". The escape code &lt; stands for < ("less than"), &gt; stands for > ("greater than"), and &amp; stands for & (ampersand). Note that the semicolon is part of the escape code; if you omit it, things won't work. Other symbols, including accented letters like é and ñ and symbols like ©, are not found on the keyboard and so are difficult to include. Again, we use escape codes like &eacute;, &ntilde; and &copy;. One especially useful escape is &nbsp;, which produces a "non-breakable space", that is, a blank space that does not go away. You can use it to force a space or to keep two words together on one line. There's a complete list of escapes at this site. Finally, you can include any Unicode character as &#xhhhh;, where hhhh is the hex value, or in decimal by omitting the x. For instance, &#x05D0; and &#1488; both produce the Hebrew character alef ‫;א‬. Headings To include headings in your web pages, with larger and bolder text that stands out, use the <H#> </H#> tags. Replace "#" with a number from 1-6 and surround your heading with these two tags. The text inside will be bold, usually larger (depending on the number -- H1 is the largest), and surrounded by empty lines. What you write in HTMLHow it appears on your web page<H1>This is an H1 heading.</H1> <H2>This is an H2 heading.</H2> <H3>This is an H3 heading.</H3>
  • 23. <H4>This is an H4 heading.</H4> <H5>This is an H5 heading.</H5> <H6>This is an H6 heading.</H6>This is an H1 heading. This is an H2 heading.This is an H3 heading.This is an H4 heading.This is an H5 heading.This is an H6 heading. Always close your header tag (using the appropriate closing tag) or the rest of your page will be displayed in the larger, bolder text. The closing tag must match the opening tag: if you open with <H2>, you must close with </H2>. Text Style, Size and Color With a few tags, you can make text bold, italicized, underlined, bigger, smaller or even a different color. What you write in HTMLHow it appears on your web page<B>This tag makes text bold!</B>This tag makes text bold!<I>This tag italicizes text!</I>This tag italicizes text!<U>This tag underlines text!</U>This tag underlines text!<TT>Here's some fixed width text!</TT>Here's some fixed width text! To display colored text or change the size of the text, use <FONT>. The <FONT> tag doesn't do anything by itself, but it allows you to set the size and color of text through its attributes. The following table shows how to use the <FONT> tag. What you write in HTMLHow it appears on your web page<FONT COLOR="blue">This is blue text!</FONT>This is blue text!<FONT SIZE=5>This is big text!</FONT>This is big text!<FONT COLOR="red" SIZE=6>This is really big red text!</FONT>This is really big red text! The color should be one from the table of background colors for the BODY tag. The size can range from 1-7 with 1 the smallest and 7 being very, very large. You can also use relative sizes, like size=-1 and size=+1.
  • 24. Other Text Tags Lines: You've probably noticed the horizontal lines that separate sections of these instructions. You can include such lines in your page by typing <HR> ("horizontal rule") at each place where you would like one to appear. Like <BR>, <HR> does not require a closing tag. The line need not stretch across the whole page; try <HR width=75%>. Alignment: To center a heading or a paragraph, use the <CENTER> </CENTER> tags to surround whatever you would like to be centered. You can also use the ALIGN=RIGHT or ALIGN=CENTER attribute with headings and paragraphs, as in <P ALIGN=CENTER>. Pre-formatted Text: If you cannot find a way to make your text appear the way you want, you can always resort to using the <PRE> </PRE> tags. Any text placed between these two tags will appear exactly as you type it, including spaces, indentation and empty lines (though you need escape codes for <, > and &). But the text will appear in a fixed-width font, will not flow naturally, and won't wrap at the edge of your window. Tables: Our tabular displays are created with the <TABLE> tag; it's one of the topics of the next lab. Labs/Lab6/lab.css h1, h2, h3, h4 { color: #3366ff; } h2 { text-indent: .25em; } h3 { text-indent: 1.5em; } h2 small { font-size: 75%; font-weight: normal; color: black; display: inline; margin-left: .5em; } kbd { font-weight: bold; } aside.note, figure { float: right;
  • 25. width: 300px; margin: 1em; padding: 10px; border: 2px solid #ddd; border-radius: 5px; background-color: white; } figure { width: 350px; text-align: center; margin-top: -10px; } aside.info { margin: .5em 3em; padding: 20px; background-color: #eef; border-radius: 5px; } .icon { background-color: #5d5f60; /* same as Brackets toolbar background */ border-radius: 3px; vertical-align: -30%; } li.instructions { margin-bottom: .28em; } p { text-indent: 1em; } section { border-top: 1px solid black; margin-top: 2em; }
  • 26. table { border-collapse: collapse; border: 2px solid black; width: 450px; table-layout: fixed; margin: 0 2em; } td, th { border: 1px solid #555; } th { background-color: #ccf; text-align: left; padding: 2px 5px; } th:nth-child(2), td:last-child { width:50px; } tbody th { background-color: #eef; text-indent: 1em; } td { padding: 1px 2px; } td:last-child { text-align: center; } tr:last-child td:last-child { background-color: #ccf; } pre { background-color: black; color: white;
  • 27. border: 2px outset gray; } Labs/Lab5/Lab5_Excel_SH.htmlLab 5: SpreadsheetsLearning Outcomes and IntroductionTask 1: Powers of 2, Powers of 10 Task 2: Importing and Sorting DataTask 3: Graphing DataTask 4: FunctionsSubmission Learning Outcomes and Introduction During this process, you will be able to: Demonstrate your ability to layout and format a spreadsheetDemonstrate the use of relative vs. absolute references in spreadsheetsDemonstrate the use of functions in ExcelDemonstrate the use of IF and VLOOKUP in Excel Task 1:Powers of 2, Powers of 10 (20 marks)Instructions There is a reasonably close relationship between the powers of two and the powers of ten: 210 is a little more than 103, that is, 1024 is close to 1000. Similarly, 220 is more than 106 and the ratio is 1.049. The approximation is pretty good for a long distance though eventually it breaks down. Your task is to make a spreadsheet that shows how good the approximation is and find the place where the ratio first becomes greater than 2. Start your spreadsheet program (such as Excel) Enter Data: Put the numbers 0, 1, 2, ...,40 into column A.Put into column B a formula that will compute 2 raised to the power 10 times the value in column A. Put into column C a formula
  • 28. that will compute 10 raised to the power 3 times the value in column A.Put into column D a formula that will compute the ratio of B over C, that is, the ratio of how good or bad the approximation is.Set the cell format for column D to display exactly two digits after the decimal point. Prepare a Chart: Select the correct range to create a chart that shows the ratio changing for the 40 rows.Use the chart wizard ("Insert>Chart>Column" or this icon ) to create a graph that shows the ratio.Move the chart so that is beside your data as shown in the picture below. Add an appropriate chart title and remove the " legend" Save Worksheet: In this lab, you will be using a new sheet for each part, each with its own name. For task1, double-click on the tab that says Sheet1 Type the name Power2 in its place.Save the spreadsheet in a file called lab5_Firstname_Lastname under the folder COMP152Lab5 Side Note: the spreadsheet application you are using will add the correct filename extension) Do this with as little typing and as much use of Excel's extension feature as possible; you can probably do it by typing no more than two or three rows and then extending them. Your table should look like this when done, except that it will have more
  • 29. rows, more data in the graph, and a highlighted row towards the end: Note: In the example below, numbers are displayed as "floating point". You do not have to format that way, most of us prefer more common looking number formats (comma style?). No matter what format and number of decimal places you choose to display - the spreadsheet software is actually using floating point in the background to ensure maximum accuracy. Sample out put Notice that the approximation gets worse at worse than linear rate. To see just how fast it is getting worse, right-click on the bars in the chart, then select Add " Trendline" from the Chart menu. Pick the trendline that gives the best fit to the data. Task 2: Importing and Sorting Data (20 marks) It's all well and good to create synthetic data to play with, but in the real world, one usually works with real numbers. In this section, you will experiment with data from Yahoo Finance, which provides a wealth of financial information in convenient formats. Your task is to generate a table that displays stock prices and relative
  • 30. performance for two stocks for the past two or three months. You can choose any two stocks you like; interesting pairs might be selected from among Amazon, Ebay, Google, Yahoo, IBM, Oracle, Ford, GM, etc. Import DataGo http://finance.yahoo.com input in the " Search Finance" box your first stock (such as Amazon).Go to " Historical prices" (left bar on the screen), set the range of dates that you want, click on the button " Get Prices" .Go to the bottom of the page and select "Download To Spreadsheet".Either save the file and import it into Excel, or open it directly; the latter is easier.Repeat for your second stock, using the same range of dates. Note: You now have two Excel windows, each displaying something like the image shown: Attention: Move to a new tab in your lab5_Firstname_Lastname file, rename the tab to "Stock prices". Sorting Data Prepare Data: In each Excel window, delete all columns except "Date" and "Adj. Close" and delete the first row. This should leave exactly two columns in each Excel windowNow copy/paste the two data sequences into the "Stock prices" sheet.Since you have two "Date" columns with the same information,
  • 31. you can now delete one of them. Important Note: After you get rid of the duplicate date column, your sheet should have three columns and you need to Make sure column A contains the dates. Your sheet should have now only three columns.Change the headings to the corresponding names of your stock companies.Select all the cells in column A which contain dates. Change the date format to a more readable date format (e.g. December 31, 1999)Select all the numbers in columns B and C format all numbers as "comma style". Resize columns if needed.Look through columns B and C to confirm matching data (When I did this one stock had a blank row where a dividend was paid). If necessary drag price data up if you see a blank. We want to see at least 60 - 70 rows of data (working days over 3 months) to a maximum of 250 rows of data. Sort Data: Insert a new column A and insert in it numbers 1, 2 ... etc.The prices are in most recent first order and you need to reverse them:Select the three columns (include your headings in row 1), then on the Data menu, pick "Sort...", and sort the data by "Date" from oldest to newest. Be very careful doing sorting!! If you do it incorrectly you will create big problems! At this point, if you select columns B and C, you can compare the two stocks, but it won't be very interesting if their prices differ by too much. So the next step is
  • 32. to make two new columns that show how the prices have changed in proportion to the first value.In E2, enter the formula =C2/C$2. Extend it down to the end of column E. Repeat in F1 for column D, using the formula =D2/D$2. Attention: The formula =C2/C$2 is not an error. Normally when Excel extends formulas it modifies cell references, using relative values. The $ in a reference like C$2 tells Excel to leave that cell reference unchanged ("absolute" instead of relative), so the subsequent formulas will be =C3/C$2, =C4/C$2, etc. Thus each cell will contain the ratio of the price to the initial price. Sample out put Task 3: Graphing Data (10 marks) The next step is to draw a graph of your data. Excel will let you display data in a lot of different ways, some sensible and some definitely not. We want to see two graphs here. One can be a plain vanilla graph that shows the comparison between the two stocks in a simple way, like this:.InstructionsUse the chart wizard ("Insert | Chart" or this icon to create a graph that looks approximately like the one above but with a meaningful title, proper labels, etc.Use the chart wizard to create another graph from exactly the same data that is as different from the previous one as you can manage while still displaying the same information in a form that can potentially be understood. Place it near the other chart.Make the two charts approximately the same size and position them so the charts and the numeric data
  • 33. can all be seen at once.Preview your work. Look at your worksheet in Print (page) preview.In MS Office, selecting print preview and page layout lets you scale automatically to print on one page or perhaps multiple pages but a width of one page. You must do this operation for each worksheet individually as different sheets have different printing needs.We are not printing anything for this assignment but this may be important later. If you need a printed chart or worksheet to put in a hard copy assignment or report. Reminder: Save the lab5_Firstname_Lastname file in your Lab5 folder and close the file. Task 4: Functions (10 marks) Reminder: Move to a new tab in your lab5_Firstname_Lastname file, rename the tab to "Coffee". Create a spreadsheet with the information in the picture below. InstructionsDisplay in column B the correct description of the product in column A.Use the vLookup function with information from "Product Table". Use absolute cell reference so you can copy the function down. Display in C the cost per unit (same hints from above) Write a formula in column D to calculate retail cost. Retail cost is calculated using the percentage in “Retail markup”.Create an IF function in column F to calculate total retailUse "Discount" if quantity is greater
  • 34. than 10In column G write a formula that calculates sales tax To calculate sales tax use "Tax Rate" percentageIn column H write a formula to calculate total (subtotal + taxes)Display the current date in cell B2; format the cell to a readable date format (eg. December 15, 2013)In my example, we have only four items to invoice. Add few more items to invoice.Preview your work and if necessary change the page layout and fit the sheet content to one printed page. Attention: Save and close the file in your lab5 folder Submission At this point you should have two spreadsheets in your Lab5 folder. Check through them to make sure they look right. When everything is working, place a copy of your files into your lab5 Dropbox in D2LOVERALL ASSESSMENT (10 marks) Ten marks are set aside for overall assessment. 8 to 10 marks are given for outstanding work. The assessment proceeds as follows: 8 - 10 marks given for strong evidence of superior grasp of spreadsheet concepts. The assignment is completed in an exemplary manner.4 - 7 marks given for evidence of reasonable understanding of the spreadsheet concepts. The assignment is correctly completed. 1- 3 marks given for evidence of some understanding of spreadsheet concepts. Three quarters of the assignment is correctly completed. submit your lab5_Firstname_Lastname file. NOTE: This assignment is to be done individually. You can
  • 35. help one another with problems and questions, but in the end everyone must do their own assignment. CriteriaMarksAll tasksOVERALL ASSESSMENT10Task 1Powers of 2, Powers of 1020Task 2Importing and Sorting Data 20Task 3Graphing Data10Task 4Functions15Total75 Labs/Lab5/lab.css h1, h2, h3, h4 { color: #3366ff; } h2 { text-indent: .25em; } h3 { text-indent: 1.5em; } h2 small { font-size: 75%; font-weight: normal; color: black; display: inline; } kbd { font-weight: bold; } aside.note, figure { float: right; width: 300px; margin: 1em; padding: 10px; border: 2px solid #ddd; border-radius: 5px; background-color: white; } figure { width: 350px; text-align: center; margin-top: -10px; } aside.info { margin: .5em 3em; padding: 20px; background-color: #eef;
  • 36. border-radius: 5px; } .icon { background-color: #5d5f60; /* same as Brackets toolbar background */ border-radius: 3px; vertical-align: -30%; } li.instructions { margin-bottom: .28em; } p { text-indent: 1em; } section { border-top: 1px solid black; margin-top: 2em; } table { border-collapse: collapse; border: 2px solid black; width: 450px; table-layout: fixed; margin: 0 2em; } td, th { border: 1px solid #555; } th { background-color: #ccf; text-align: left; padding: 2px 5px; }
  • 37. th:nth-child(2), td:last-child { width:50px; } tbody th { background-color: #eef; text-indent: 1em; } td { padding: 1px 2px; } td:last-child { text-align: center; } tr:last-child td:last-child { background-color: #ccf; } Labs/Lab5/spreadsheets_files/chartwizard.jpg Labs/Lab5/spreadsheets_files/image006.jpg Labs/Lab5/spreadsheets_files/image004.png Labs/Lab5/spreadsheets_files/example.jpg Labs/Lab5/spreadsheets_files/yahoo1.jpg Labs/Lab5/spreadsheets_files/power2.jpg