Download presentation
Presentation is loading. Please wait.
Published byUrsula Norman Modified over 9 years ago
1
CSC 110 - Intro. to Computing Lecture 26: XML & Course Review
2
Announcements Essay due today Please e-mail essay & your service learning logs Service Learning due 5PM Friday Quiz #6 available on class web page Due at start of final If you hand it in earlier, I will give you the quiz solutions to help you study
3
XML DTD XML documents include Document Type Definition (DTD) which specify document’s organization
4
XML Example XML uses tags from the DTD to label data in a document File can now be “mined” like a database!
5
In-Class Exercise Define the DTD and write an XML document for: Election ballot Collection of CDs
6
Final’s Format Final will be similar to midterm A few fill-in-the-blanks or multiple choice, but mostly problem solving and short answer Final will be closed-book and closed-note
7
Material for Final Focus will be on material not covered on midterm Starting with Palgo and Robotran Older material included only when it relates to most recent material Try testing understanding of material rather than rote memorization Important to understand hows and whys
8
Program Trace 1 x = 4 + 2 2 y = 8 * 1 3 z = y – 3 4 x = x + 1 5 z = y - x 6 y = y / 2 7 z = “x” 8 y = z + “b” Line#xyz 16 xyz 2 xyz 28 3 xyz 28 35 4 xyz 7 5 xyz 1 6 xyz 64 7 xyz x 8 xyz xb
9
Tracing a Loop 1 x = 5 2 y = 3 3 total = 0 4 repeat y times 5 total = total + x 6 end 7 print total Lin e Cond- ition xy tota l output 15 23 30 41 of 3 55 42 of 3 510 43 of 3 515 7 Lin e Cond- ition xy tota l output Lin e Cond- ition xy tota l output 15 Lin e Cond- ition xy tota l output 23 Lin e Cond- ition xy tota l output 30 Lin e Cond- ition xy tota l output 41 of 3 Lin e Cond- ition xy tota l output 55 Lin e Cond- ition xy tota l output 42 of 3 Lin e Cond- ition xy tota l output 510 Lin e Cond- ition xy tota l output 43 of 3 Lin e Cond- ition xy tota l output Cond- ition 515
10
Tracing n! 1 num = input_num(“What number?”) 2 fact = 1 3 for i = 1 to num 4 fact = fact * i 5 end 6 print fact Line Cond- ition nu m factiOutput Cond- ition 14 21 31 < 41 Cond- ition 41 32 < 42 Cond- ition 42 33 < 43 Cond- ition 46 34 < 44 Cond- ition 3 424 Line Cond- ition nu m factiOutput 21 31 < 41 41 32 < 42 42 33 < 43 46 34 < 44 424 35 < 45 Line Cond- ition nu m factiOutput 31 < 41 41 32 < 42 42 33 < 43 46 34 < 44 424 35 < 45 624
11
Palgo Loop Selection Each of Palgo’s loops serves different purpose repeat Executing the commands a specific number of times for Remembering the number of times that we are executing the instructions in a loop Very useful for lists! while Executing a loop for as long as needed to meet a specific condition
12
Robotran Example program walker var distance var angle while true do let distance = getRand(3) go forward distance inches let angle = getRand(360) turn right angle degrees end define getRand (parm max) returns float var number = random/100.0 * max return number end
13
Simulations Different types of simulators Continuous Simulations evaluates and computes results at every instance in time Discrete Event Simulations emulate world by examining when 2+ entities interact What are limitations of using simulations?
14
Ethics Common understanding of ethics: Golden Rule – Do unto others as you would have them do unto you Sniff Test – Does it seem like it is ethical? Major systems of ethics: Divine dicta -- The divine states what is right Natural law -- Human intuition and conscience guides what is right Relativism -- Prevailing standards set what is right; must consider each situation in its environment
15
Ethics - Dentology One must fulfill duties defined by law, religion, and society Cannot refuse to perform these duties for any reason Based upon principle of universality If an action would be wrong in any situation, then it is wrong in every situation
16
Ethics – Utilitarianism Calculates whether actions are moral or immoral Evaluate benefits that arise from an action Calculate the bad caused by an action Determine if good outweighs the bad “The greatest good for the greatest number of people”
17
Ethics - Analogies When deciding if an action is acceptable, people often relate it to a similar situation Use analogous decisions from the past to help make the moral choice in the present Computers can make this more difficult Not always clear if situations are comparable Something that is good normally may not be once the power and speed of computers are included
18
Ethics for the Final Important consideration: Always clearly state and justify your arguments If needed, pick a side and argue it Corollary: Even the best opinion must be backed up by a strong argument
19
Semantic Networks Method of representing knowledge Focuses on relationship between items Typically shown as directed multi-graph Data items are the vertices (points) Relationships are the edges (lines) Relationships are one-way Know how to create & read these
20
Artificial Neuron Operation Effective weight of an input is the input value multiplied by input’s weight If sum of effective weights is equal to or above threshold neuron outputs 1 When sum of effective weights is less than the threshold, neuron outputs 0
21
Artificial Neuron Example Consider the following neuron: Output would be a 1 when threshold is 0.3 + (-3) + 0 + 4 = 1.3 or lower ValueWeightEffective Weight 10.3 1-3 020 144
22
Ring Topology Each machine connected to 2 others All data flows in one fixed direction Source 0 Target 0 1 1 Source 1 Target 1 1 1
23
0 Star Topology All data flows through central node Need to be careful to handle collisions Source 1 Target 1 1 1 1 Source 0 Target 0 0 0
24
Bus Topology Machines connected via shared bus But needs sophisticated collision handler Source 1 Target 1 11 1 1 1 1 Target 0 Source 0
25
HTML & XML What HTML tags are and how they work Limitations of HTML to describe the contents of the page How to define a DTD and how to use this in an XML document
26
Essay on Final Grading rubric used to grade your final: Stating clear thesis 20% in opening paragraph (Correctly) citing at least 120% ethical system Making convincing arguments25% to support your argument Length 5% Spelling 5% Grammar10% Organization10% Clarity 5%
27
For the Final I will be in my office most of Monday through Wednesday Can answer questions, discuss any issues you may have, anything students would like
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.