Sunday, May 17, 2015

Introduction to Loops - For Loop

There are several methods used for repetition within structured algorithms; the first that we will be learning is Loops.

The three types of Loops that we will be covering are:
For Loop (also known as Do Loop or Counter Controlled Loop)
While Loop
Repeat Until Loop

The For loop is used to repeat code for a specified number of times.  It falls under the control structure of repetition control structure.

First we take a look at the For Loop.  This is used when the number of repetition is known.  The syntax is as follows:





Example:
Problem Statement:  Calculate and output the sum of ten numbers.

  1. total = 0
  2. For x = 1 to 10
  3.      Print "Enter a number"
  4.      Input num
  5.      total = total +1
  6. Next
  7. Print "The sum of ten numbers entered is", total
  8. Input key

Line 1 is an example of initializing a variable.  That means that we are giving it a starting value.
Line 2 indicates that we will repeat lines 3-5 for ten times.
Line 3 is an output statement hosting a prompt.
Line 4 is an input statement whereby the value entered will be stored in the variable num.
Line 5 allows a tally to be kept each time a number is entered.
Line 6 terminates the loop.  The syntax states End For, however, the compiler uses the command Next.
Line 7 displays the total of the ten numbers with a suitable label.
Line 8 terminates the algorithm

Now, you try one:  Calculate and output the average current GPA of the students in your class based on their first, second and third form GPA.  Ask the user to enter the number of students in the class, store it in the variable Class; that variable becomes your terminating value.

Sunday, February 22, 2015

Conditional Algorithm

Conditional algorithms have selection statements in them.  Their control structure is known as Selection Control Structure.

The first illustration is that of the if-then construct.
The second illustration is that of the if-then-else construct.

Examples:
1. If grade is 70 or more, output Pass.
2. If grade is 70 or more, output Pass; otherwise output Fail.

Example Problem:
Write an algorithm that determines and outputs if the average of a student allows him to pass or fail; the passing mark is 70.

Solution #1: if-then construct
Print "Enter the average of a student"
input avg
if avg >= 70 then
print "Pass"
end if
input key

Solution #2: if-then-else construct
Print "Enter the average of a student"
input avg
if avg >= 70 then
print "Pass"
else
print "Fail"
end if
input key

Now you try one:
Write an algorithm that prompts the user to enter the name and cost of two items.  The algorithm should calculate and output the total cost.  If the total exceeds $25.00 then offer a discount of 10%; otherwise a discount of 5%; show the new total after discount.

Algorithms

There are four types of algorithms:  Simple, Conditional, Loops and Arrays

Simple Algorithms - basic calculations
Conditional Algorithms - selection statements

Algorithms are series of instructions that rigorously defines the solution to a problem.

The attributes of an algorithm are:

  1. Must be precise
  2. Must be ambiguous
  3. Must be finite
  4. Must be done in a logical order
Example of given problem:
Write an algorithm that prompts the user to enter two grades, and shows the average of the two grades.

Indicators that it is a simple algorithm:  basic calculation of entering data, performing calculation, and outputting results.

Solution:
Print "Enter a grade"
Input grade1
Print "Enter another grade"
Input grade2
Let total = grade1 + grade2
Let avg = total / 2
Print "The average of two grades is", avg
Input key

Sunday, February 8, 2015

Problem Solving Phase

Click on the link below for a short video about the five steps in the problem solving phase along with an important message.

Intro to Programming by Ms Young


Thursday, February 5, 2015

Problem Solving Phase

The key to solving a problem is understanding what is being asked to do, logic how to do it, and get it done.



The Five (5) Steps in Problem Solving Phase
  1. Define the problem
  2. Find a solution
  3. Evaluate alternate solutions
  4. Choose the most efficient solution and write an algorithm
  5. Test algorithm for correctness
To define the problem, programmers use a defining diagram, commonly referred to as an IPO table. 
Defining Diagram - a three column table that separates a given problem into Input, Processing, and Output.

The IPO table does not solve the problem; it simply outline the procedural steps.  Calculations are not shown in the table.  

Example of IPO Table
 
Problem: Calculate and output the total cost of three items.


Input
Processing
Output
Cost1
Cost2
Cost3
1.   Read Cost1, Cost2, Cost3
2.   Calculate Total
3.   Print Total
Total

Input
We have assigned a name (variable name) to each of the cost values that will be entered.
we will learn more about variables at a later point.

Processing
Each processing step is numbered.  
The processing steps are what steps the computer will have to do to solve the problem.
The first processing step is always to (read) the variables that are inputted.
The final processing step is always to display (or print) was is to be outputted.

Output
Anything that needs to be displayed or the result of what is being asked to solve

You try one...
Prepare the defining diagram for the following problem:  Calculate and output the average of two quiz grades.  (hint...there are four processing steps)

Wednesday, January 28, 2015

Thursday, January 22, 2015

The Internet and the World Wide Web

The Internet and The World Wide Web
ž  Many people use the terms Internet and World Wide Web (aka. the Web) interchangeably, but in fact the two terms are not synonymous. The Internet and the Web are two separate but related things.
ž  The Internet is a massive network of networks, a networking infrastructure. It connects millions of computers together globally, forming a network in which any computer can communicate with any other computer as long as they are both connected to the Internet. Information that travels over the Internet does so via a variety of languages known as protocols.
ž  The World Wide Web is a way of accessing information over the medium of the Internet.
ž   It is an information-sharing model that is built on top of the Internet. The Web uses the HTTP protocol, only one of the languages spoken over the Internet, to transmit data.
ž  The Web also utilizes browsers, such as Internet Explorer or Firefox, to access Web documents called Web pages that are linked to each other via hyperlinks.
ž  The Web is just one of the ways that information can be disseminated over the Internet.
ž  The Internet, not the Web, is also used for:
ž   e-mail, which relies on SMTP (simple mail transfer protocol)
ž  Usenet (worldwide bulletin board system) news groups
ž  Instant messaging and FTP (file transfer protocol; works the same as HTTP).
ž  So the Web is just a portion of the Internet

Search Engines...
ž  A ‘search engine’ keeps indexed records of all the web pages that can be accessed via hot links.
ž  It is a software system that is designed to search for information on the WWW
ž  There are three major types of search engines:
¡  Crawler-based search engines
¡  Human-powered directories
¡  Meta-search engines
ž  Crawler-based search engines create their listings automatically by using a piece of software to ‘crawl’ or ‘spider’ the web and then index what it finds to build the search base. 
ž  They are good when you have a specific topic in mind and can be very efficient in finding relevant information in that situation. 
ž  Examples include:
¡  Google
¡  AllTheWeb
¡  AltaVista
ž  Human-powered directories depend on human editors to create their listing.  Typically, webmasters submit a short description to the directory for their websites, and these manually edited descriptions will form the search base.
ž  They are good when you are interested in a general topic of search.
ž  Not an efficient way to find information when a specific search topic is in mind.
ž  Examples include:
¡  Yahoo directory 
ž  (Yahoo also provides crawler-based results)
¡  Open Directory
¡  LookSmart
ž  Human-powered directories depend on human editors to create their listing.  Typically, webmasters submit a short description to the directory for their websites, and these manually edited descriptions will form the search base.
ž  They are good when you are interested in a general topic of search.
ž  Not an efficient way to find information when a specific search topic is in mind.
ž  Examples include:
¡  Yahoo directory 
ž  (Yahoo also provides crawler-based results)
¡  Open Directory
¡  LookSmart
ž  Meta-search engines transmit user-supplied keywords simultaneously to several individual search engines to actually carry out the search. 
ž  Search results returned from all the search engines can be integrated, duplicates can be eliminated and additional features such as clustering by subjects within the search results can be implemented by meta-search engines.
ž  Meta-search engines are good for saving time by searching only in one place and sparing the need to use and learn several separate search engines.

Friday, November 21, 2014

First Semester IT Exam Schedule



Practical Exams:
Class 3A
     Spreadsheet -December 2, 2014 [Day 3] @ 1:22 pm - 2:12 pm
     Database - December 3, 2014 [Day 4] @ 8:10 am - 9:00 am

Class 3C
     Spreadsheet -December 1, 2014 [Day 2] @ 12:32 pm - 1:22 pm
     Database - December 1, 2014 [Day 2] @ 1:22 pm - 2:12 pm

Class 3D
     Spreadsheet -December 2, 2014 [Day 3] @ 10:55 am - 11:45 am
     Database - December 3, 2014 [Day 4] @ 2:12 pm - 3:02 pm

Theory Exam:
All 3rd Form Classes on Tuesday, December 9, 2014 @ 1:10 pm - 3:10 pm

Wednesday, November 5, 2014

Practical Test on Access Dates

3A  Cycle 8 Day 4
3C  Cycle 8 Day 6
3D  Cycle 8 Day  5

The test will assess you ability to:
  1. Create a database
  2. Create tables
  3. Format fields
  4. Select Primary Key
  5. Create a relationship
  6. Perform Select queries to extract data based on criteria
  7. Perform Make-table queries to create new tables based on criteria
  8. Perform Summary queries using functions to extract data

Thursday, October 30, 2014

Test 3 Dates

3A   Cycle 7 Day 5
3C   Cycle 7 Day 6
3D   Cycle 7 Day 7

Database Notes (Part 2)

Field format

This property is used to personalize the way in which data is presented on the screen or in a report.
This can be established in all types of data except the OLE object and Autonumerical.

For Numeric and Currency fields the options are:

General number: presents numbers in the same way as they have been introduced.

Currency: presents the values introduced with a thousandth separator and the assigned monetary symbol in Windows e.g. $

Euro: uses the currency format, with the euro symbol.

Fixed: presents the values without the thousandth separator.

Standard: presents the values with the thousandth separator.

Percent: multiplies the value by 100 and adds the percent sign (%).

Scientific: presents the number with scientific notation.

Date/Time fields have the following formats:

General date: if the value is only a date no time is shown; if the value is only a time no date is
shown. This value is a combination of the Short date and Long time values. E.g. '3/4/93', '05:34:00 PM' and '3/4/93 05:34:00 PM'.

Long date: the date is seen together with the day of the week and the month in full. E.g. Monday, August 21, 2000.

Medium date: presents the month with the first 3 letters. E.g. 21-Aug-2000.

Short date: the date is presented with 2 digits for the day and month. E.g. 01/08/00 or 01/08/2000. The Short date format assumes that dates between 1/1/00 and the 31/12/29 are dates between the years 2000 and 2029, and that the dates between 1/1/30 and the 31/12/99 are for the years 1930 to 1999.

Long time: presents the time in normal format. E.g. 05:35:20 PM

Medium time: presents the time in PM or AM format. E.g 5:35 PM

Short time: presents the time without seconds neither PM. E.g 17:35.

Yes/No fields have predefined Yes/No, True/False, and On/Off formats available.
Yes, True and ON are the equivalents of yes, as are No, False, Off of no.

Note: The default control for Yes/No data is the verification box as we seen in Datasheet the data of this type appears in a verification box and does not affect the format property. If we choose to see the effect we need to change the default control in the Lookup tab in the field properties, in the Display control property select Text box as we will show you next.

The Text and Memo fields do not have predefined formats available, for the Text fields we will need to create your own custom formats.

Class 3D - Rubric for Database Model

Appropriate labelling of model       5 points
Labelling of objects displayed        5 points
Accurate interpretation/representation of database     5 points
Creativity in production of model    5 points
Submission on time - 11/7/14         5 points

TOTAL: 25 points
Graded in the category of 'Other'

Tuesday, October 28, 2014

Spreadsheet Assignment -ALL 3rd Form Classes

Complete the following tasks using MS Excel.  
Submit to marcelliyoung@yahoo.com no later than Monday, November 3, 2014 before 7pm.
Assessment being graded in the category of 'Other'.  
Total points: 30

Recreate the following spreadsheet starting at cell A1.  Font Face: Times New Roman. Font Size: 12
Click on the image to enlarge.


Instructions:

In an appropriate area of your spreadsheet, insert the following:










  1. Insert two blank rows and in Cell A1, enter your name and class,  In cell C1, use a function to include the actual date.  [2pts] 
  2. Insert a heading labelled as CALORIE COUNTERS.  Bold, center across selection, and change font size to 14.  [3pts]
  3. In cell A26, insert the label Number of Items.  In cell B26, using a function, state the number of food items displayed.  [2pts]
  4. In cell A27, insert the label Highest Calorie.  In cell B27, using a function, state the highest calories from the range. [2pts]
  5. In cell A28, insert the label Lowest Fat.  In cell B28, using a function, state the lowest fat from the range.  [2pts]
  6. In cell A29, insert the label Number of Fast Foods.  In cell B29, use a function to state the number of fast food items based on column A contents. [2pts]
  7. In column H, insert the column heading Status.  Determine whether the item is Good or Bad based on the following.  If the calories is increased by 5%, and is still less than 180, then the item is good. [4pts]
  8. In column I, insert the column heading Recommended.  Using vlookup, determine the status of each item.  [5pts]
  9. Create a criterion and extract all Category that are Fast Foods.  Place the results in an appropriate area of the spreadsheet.  [4pts]
  10. Create a criterion and extract all Category that are Baked Goods with Calories more than 200.  Place the results in an appropriate area of the spreadsheet.  [4pts]

Excel Board Game Grading Rubric

Assignment due date changed.  New due date:  November 5, 2014
Submit by email to marcelliyoung@yahoo.com
Ensure that the names of all group members are included in the email cover letter.

Grading Rubric:

Use of Excel functions                   5 points
Proper construct of board game    5 points
User friendliness of game              5 points (if an instruction sheet is needed, prepare in Word)
Creativity                                        5 points
Overall game concept                    5 points
Submission on time                        5 points

Game is to function in Excel.  If an instruction sheet is prepared, submit both documents as attachments to your email.
Game graded in category of 'Other'
Total points: 30 points


 

Wednesday, October 22, 2014

Database Notes Part 1

A database is a collection of related data about a particular subject stored together. There are two forms of database: Manual Database and Computerized Database. For our purpose, we focus on Computerized Database, and particularly on relational database being Microsoft Access.
There are two types of database:
1. Flat File - one dimensional database containing/storing simple lists. An example is an electronic address book.
2. Relational Database - RDBMS. An example is Microsoft Access; relational meaning that more than one table may be used for storing data. The tables are linked by relationships in a manner to facilitate easy access of information.

Hierarchy of Database Production

A table is a collection of related data about a specific subject.
A field is column in a table that contains a category of information. Insertion of fields is done in design view.
Formatting of data types is done while creating fields. There are four common data types used: text, number, currency and date/time.
A record is a group of related fields pertaining to one subject; it is a row of data in a table. Inputting of records is done in data sheet view.
Microsoft Access uses objects. An object is a sub program that manages one aspect of the database. There are four objects used in Access: Form, Table, Query and Report.
Forms are used for input of information.
Tables are used for storage.
Queries are used for processing of information.
Reports are used for output.
While Forms are the first object listed, for our purposes, we will focus on creating Tables in design view. We create them in this view in order to customize them to our needs.
STORAGE - After creating your database, tables are created to store information. Within tables, fields are formatted and records are inputted. Field properties are formatted from the general tab on the lower left hand of your screen when in design view.
Field Properties:
  • Field size - the default field size for a text field is 50 and cannot exceed 255.
  • Format - changes the way data is displayed; not stored to create custom formats.
  • Input Mask - used to insert special characters in a field.
  • Validation Rule - ensures that a number being entered is withing the specified range. Validation text is a message that appears when the validation rule is violated.
  • Required - Yes or No
  • Primary Key - a field that uniquely identifies each record in a table; speeds up operations such as data retrieval, sorting and the running of queries. Primary key allows users to establish relationships between tables so that they can be joined.
After creating and formatting fields in design view, switch to data sheet view by clicking on the icon that resembles a table on the tool bar. At this point, you will be asked to save your table and to select a primary key. Records can now be entered.
Many tables can be created and stored in one database; sometimes the data is stored in more than one table and therefore, the tables can be linked by forming a relationship.
We will stop at this point and continue in Part Two.

Saturday, October 11, 2014

Test 2 Notes

Spreadsheet (Excel)

Test 2 will focus on:

  • Basic functions in Excel
  • If statement with calculations
  • Vlookup
  • Advanced Filtering
  • Octal conversion to binary and to decimal (Two questions)

Syntax

If statement
if(logical_test,value_if_true,value_if_false)
            (1)            (2)                (3)

1.  The logical test is what tests the condition.  For example average > 70
2.  The value_if_true will be displayed if the condition is met
3.  The value_if_false will be displayed if the condition is not met

Vlookup
vlookup(lookup_value,table_array,col_index_num,range_lookup)
                     (1)               (2)                  (3)                  (4)

1. The lookup value is the cell address that has the value that we will look up in the table array to compare and find the answer,
2. The table array is where on the spreadsheet has the columns with the answer and comparison data.
3. The column index number is the number of the column that has the answer we are searching for.
4. The range lookup is either true or false.  False is what we are looking up for is exact and True if it is an approximate.

Notes:

Filtering is extracting data based on a condition.
The condition is known as a criterion (criteria is the plural of criterion)
A criterion with one condition takes up two cells
A criteria with two condition takes up four cells

Example:
                   Name
                   ="John"
This extracts all people with the name John

                    Age
                     >17
This extracts all people who are older than 17 years

                     Items
                      B*
This extracts all Items with the name starting with the letter B

PRACTICE ACTIVITY
  1. Using the spreadsheet below, use vlookup to identify each page name.
  2. Perform advanced filtering to extract all Pages that had more than 20,000 views and Page Name has the letter N in it.
  3. Calculate if the Page views is more than 200,000 then list it as Active; otherwise list as inactive.
You can click on the spreadsheet to view as a larger image

IF Statements with Calculations:
1.  Cell A29 has the sum of three numbers.  If the sum is more than 25, then calculate and output the square of the sum; otherwise calculate and output the cube of the sum.
2.  Cell B3 has a value.  If the value is less than 100, then output that the value is small; otherwise output that the value is larger.
3.  Cell G78 has a value.  If the value exceeds 50, add 10% to the value; otherwise, add 3% to the value.  (Remember that the % sign is not to be used in the calculation; it should be represented in decimal format)
4.  If the sum of B3 to G3 is more than 100, then calculate the product of cell B3; otherwise, calculate the average of the range.

GOOD LUCK ON YOUR TEST

A little Halloween fun...

click on the link below for a Halloween scavenger hunt
http://garfield.com/game/scary-scavenger-hunt

Friday, October 10, 2014

Test 2 Notification

Please note that Test 2 is scheduled as follows:

3A -Day 1 - Thursday, October 16, 2014
3C -Day 7 - Wednesday, October 15, 2014
3D -Day 6 -Tuesday, October 14, 2014

Test 2 -Theory Test on Excel

Sunday, October 5, 2014

Chemistry Students - check this out

Hey Chemistry Students... try this challenge.  Make sure to click play to test your knowledge on the elements.  Don't worry... this is not being graded...just for educational fun!

http://www.brainrush.com/lesson/chemical-families