IB Computer Science year 2 - Frankfurt International School - Dave_Mulkey@fis.edu - 2016-17 |
Next graded
assignment : Pseudocode Quiz on Monday 20 March - about HASHING |
Links
: IBCS
Course Guide
Pseudocode
Processing
Lessons Java Tutorial Java Notes by Eck McFadyen Java Textbook Wu Java Textbook Internal Assessment Project Notes 2017 IGCSE Vocab CS-Dictionary Notes and Review Page (for 2017 exams) Last Year's Blog |
Here is a complete set of review notes: Notes
and Review Page (for 2017 exams)
Basically - the stuff at the top is most important, and the links below
are less important.
Here are the most significant and useful links:
Past Papers : May2016
Nov
2015 May
2015 May
2014
Nov
2014 Specimen
Exams |
PAPER 1 = Core Syllabus+Notes Topic
1.1 - System Fundamentals Briefer
version
of 1.1 with vocabulary markup HL PAPER 1 - HL extension = Syllabus Notes for
HL Topic 5 - Abstract Data Structures (Michael Brookes) HL Topic 6 & 7 : Topic
6 - System Resources Devices
Vocabulary (Mulkey) |
Paper 2 - Option D Notes (Mulkey) - OOP Option OOP Design Notes JETS Java Specification |
PAPER 3 Case Study (HL Only) Case Study [HL] for 2017 = Medicine |
Vocabulary - Old Glossary Vocab Interactive(download, run .jar file) |
==== Read the textbook - Computer Science Illuminated
====
Read this book "lightly" - don't try to memorize every word
- focus on vocabulary
Ch 1 - 1.1, 1.3 Ch 2 - All Ch 3 - all except compression Ch 4 - 4.1, 4.2, 4.4 until p 104 Ch 5 - 5.1, 5.2 HL = 5.3, 5.4 |
Ch 6 - 6.1, 5.2, 6.5 Ch 7 - All (7.6 is HL only) Ch 8 - HL only 8.1 - 8.6 8.7 is for SL and HL Ch 10 - SL - 10.1, 10.2, HL all sections of Ch 10 |
Ch 13 - Optional and interesting Ch 15 - All Ch 16 - All Ch 17 - 17.2, 17.3 Ch 18 - Optional |
Try this Vocabulary Review : Vocab Interactive(download, run .jar file)
We can finish Paper 2 Nov 2014
Although tomorrow's class is cancelled, there will be some last minute
review suggestions on this blog tomorrow.
Look at this link: Notes and Review Page (for 2017 exams)
The teacher will explain which links are worthwhile and
which are not.
Basically - the stuff at the top is most important and the links
below are less important. But here is a quick synopsis:
Top Page :
PAST EXAMS - take an
exam, WRITE solutions on paper,
check your solutions against
the mark-scheme
or ask the teacher to look at
your solution
2nd Page :
Syllabus Notes with Teach
Explanations -
read the notes
for each syllabus section
FOCUS on vocabulary that is new or
unclear,
and find out what it means.
You may find the
versions with VOCABULARY MARKUP
very helpful for review.
3rd Page :
Paper 2 OOP
- Option
D Notes (Mulkey) - OOP Option
Paper 3 Case Study - Case
Study [HL] for 2017 = Medicine
==== Read the textbook -
Computer Science Illuminated ====
Read this book "lightly" - don't try to memorize every word
- focus on vocabulary
Ch 1 - 1.1, 1.3 Ch 2 - All Ch 3 - all except compression Ch 4 - 4.1, 4.2, 4.4 until p 104 Ch 5 - 5.1, 5.2 HL = 5.3, 5.4 |
Ch 6 - 6.1, 5.2, 6.5 Ch 7 - All (7.6 is HL only) Ch 8 - HL only 8.1 - 8.6 8.7 is for SL and HL Ch 10 - SL - 10.1, 10.2, HL all sections of Ch 10 |
Ch 13 - Optional and interesting Ch 15 - All Ch 16 - All Ch 17 - 17.2, 17.3 Ch 18 - Optional |
Further Down
Vocabulary - Old
Glossary Vocab
Interactive(download, run .jar file) Animated
General CS Vocab
The Old Glossary is probably about 90% useful -
which makes it a lot better than the non-existent new glossary.
It has been
updated to be as close to the new syllabus as possible, but it's not
perfect.
The
Interactive vocabulary test is probably about 75% useful. The Animated
General CS Vocab
is probably
about 75% useful.
CS and IT General Notes - originally written for ITGS, but contain lots of useful explanations of general computer concepts
Other Stuff
Past Exams from Old
Syllabus (pw needed) - Nov
2013 May
2013 Nov
2012 May
2012
Note
that these past exams have about an 80% overlap with the new syllabus.
So
there may be some questions that are not useful, but most are useful.
Answers
are provided in the [Marks] folder. Keep in mind the Markschemes
give "good" answers.
Other
answers are possible and will receive marks, so don't assume your answer
is wrong
just
because it does not match the Markscheme exactly. The case study
questions
at the
end of paper 2 do NOT apply to the new syllabus, so ignore them.
Lots more
below
We will look at this solution program (Lists) for yesterday's practice:
https://dl.dropboxusercontent.com/u/275979/ibcomp/BlueJLists.zip
We will also look at Paper 2 in the Specimen Exams
FormulaTrees in Arrays (Processing)
IA
Form - Each student needs to fill in this form
and give a PDF copy to the teacher as soon as possible.
You may find this link helpful:
Read the Group 4 assignment here.
----------------------
Once you have finished and submitted your form,
you should read
these notes and answer the questions on page 3 (#1-10).
Write your answers as brief notes - we will discuss them tomorrow.
Sample Test for Medical Case Study (with solutions)
Here is a more realistic, real world problem - called Batch Delete.
An array, DATA, contains a bunch of names (Strings).
Another array, BAD, contains names that should be DELETED from the array.
The straightforward way to do this is:
- take the first BAD name
- search through DATA
- if the BAD name is found, then DELETE it from DATA,
moving remaining items ahead one position
- then delete the second BAD name, etc
This involves lots of "shuffling" of items in DATA.
Here is a more efficient algorithm, very little "shuffling":
- take the first BAD name
- search through DATA
- if the BAD name is found, then simply erase it
by replacing it with ""
- after you have done this with ALL the BAD names,
you will have an array with lots of "" entries
Now copy all the NON-BLANK entries into a new array.
Then you have an array containing only the GOOD names.
Take a pen and a sheet of paper and write one of these algorithms.
When you are finished, show it to the teacher.
Then type it into the Pseudocode Practice Tool and get it working
correctly.
Needless to say, your program needs to print out
all the remaining GOOD names.
Here are some standard algorithms that you should be able to write
quickly (in Pseudocode).
Using the Pseudocode Practice Tool, write code for each algorithm.
Work quickly!
You should have a copy of this Pseudocode specification -
you will NOT receive a copy of this during the exams,
but you may find it useful while reviewing.
Pseudocode
Specification
Today we will discuss the Data Structures described
in the Pseudocode Specification document.
*** Yesterday's 2D Array ***********************************
Here is the correct way to create an array with 24 rows and 7 columns:
TEMPWEEK= new Array(24)
loop R from 0 to 23
TEMPWEEK[R] = [0,0,0,0,0,0,0]
end loop
This is not important for the exams, as you will never need to "create"
an array -
questions will always assume the array already exists. But if you
are trying
to use the Pseudocode Practice tool to test some code, you might need to
do this.
Keep in mind that after that array is created, all it's entries are
UNDEFINED,
until the program puts a value into that position.
*************************
//--- Here are solutions for Problem 11 about Temperatures ---
TEMPS = new Collection()
//--- Create random temperatures and store in Collection ---
T = 10
loop C from 1 to 24*7
T = T + Math.floor(Math.random()*3-1)
TEMPS.addItem(T)
end loop
//--- Print all TEMPS from Collection ----
TEMPS.resetNext()
loop while TEMPS.hasNext()
output TEMPS.getNext()
end loop
//---- Create 2D array TEMPWEEK
TEMPWEEK= new Array(24)
loop R from 0 to 23
TEMPWEEK[R] = [0,0,0,0,0,0,0]
end loop
//--- Copy all TEMPS from Collection into 2D array ----
TEMPS.resetNext()
if TEMPS.hasNext() then
loop C from 0 to 6
loop R from 0 to 23
T = TEMPS.getNext()
TEMPWEEK[R][C] = T
end loop
end loop
end if
output "First = " , TEMPWEEK[0][0]
output "Last = " , TEMPWEEK[23][6]
//--- Find MINIMUM temp in TEMPWEEK ----
MIN = TEMPWEEK[0][0]
loop C from 0 to 6
loop R from 0 to 23
if TEMPWEEK[R][C] <
MIN then
MIN = TEMPWEEK[R][C]
end if
end loop
end loop
output "Minimum = " , MIN
//--- Count days when TEMPS dropped below 12 ---
// Use a Collection COLD to record Day,Time,Temp when below 12
COLD = new Collection()
loop C from 0 to 6
COLDDAY = false
loop R from 0 to 23
if TEMPWEEK[R][C] < 12
then
COLD.addItem(C)
// Day number
COLD.addItem(R)
// Hour number
COLD.addItem(TEMPWEEK[R][C]) // Temperature
COLDDAY = true
end if
end loop
if COLDDAY = true then
output "Cold on day # " , C
end if
end loop
// Notice that the exam question does not require you to write
Pseudocode,
// but rather to DESCRIBE the COLD collection and the use
// of a boolean variable to keep track of whether a day was cold.
//==========================================
You should have a copy of this Pseudocode specification -
you will NOT receive a copy of this during the exams,
but you may find it useful while reviewing.
Pseudocode
Specification
We will discuss problem 11 in paper 1 in
https://drive.google.com/file/d/0Bxd0A7EZupd2YW5NMGd3QXBQNmc/edit
Start with this simplified program:
//=== Temperatures Collection Simulation ======
TEMPS = new Collection()
T = 10
loop C from 1 to 24*7
T = T + Math.floor(Math.random()*3-1)
TEMPS.addItem(T)
end loop
TEMPS.resetNext()
loop while TEMPS.hasNext()
output TEMPS.getNext()
end loop
//================================
Here is a simplified Battleship game, written in Pseudocode:
//=== Battleship ======================We begin our review of the course with the CORE topic - Computational Thinking.
We will use these notes to review key concepts and vocabulary.
IA Meeting with Teacher to Run Program 10-15 min
Friday 10 lunch 11:45 Rodion Mon 13 lunch 11:45 Etienne 12:45 Swastik
Tue 14 lunch 11:45 Angelo
Wed 15
Fri 17 lunch 11:45 Kyle |
*** The Case Study Test will be postponed until Wed 8 Mar. ***
Today we will mark students' answers to Question
4 answers : A , B , C , D
Mr Mulkey is out sick again.
Use today to study for the Case Study test.
You might find it useful to discuss the following sample questions with
other students:
http://ib.compscihub.net/paper3/paper-3-maynov-2017
We will need to plan on marking Question
4 answers : A , B , C , D
on Monday, when Mr Mulkey returns.
*** The Case Study Test will be
postponed until Wed 8 Mar. ***
Mr Mulkey is at home with the flu today, hopefully returning tomorrow.
We will discuss your Question 4 answers on Thursday.
Spend this class studying the Case Study.
Look through the Google Doc containing all the notes about vocabulary,
watch any of the videos that you missed or did not understand.
We will discuss your Question 4 answers on Thursday.
Mr Mulkey is at home with the flu today, hopefully returning tomorrow.
Today you should watch this video about Robotics:
https://www.youtube.com/watch?v=vYg1K118dMc
If you wish to watch this on your own computer,
you may wish to find a quiet corner in the atrium.
Otherwise, the class can connect a laptop to the Smartboard
and all watch the video together.
*** Is anyone interested in an Oxford Study Course that might
be
***
*** offered in Munich - 2 days in April for 370 Euros (plus room and
board)? ***
We will discuss the description and goals of Paper 3 about the Case Study:
Here are some sample questions for question 4 - the big discussion
question (12 marks each).
Write answers that are designed to achieve maximum marks, according to the
criteria stated above.
Question A: Evaluate the implications of human resources being completely
replaced by
computer diagnostic systems - include specific examples in your answer.
We will discuss p.4
in the Case Study,
using the following videos for help:
Medical Imaging Videos (#1-7)
We will have more practice questions this week,
followed by a written test on Monday 6 March about the Case Study.
IB Reference Documents: FORMS.ZIP Assessment Criteria (IBO) Checklist (IBO)
The
finished project must be submitted on a USB stick,
organized as required in the IBO FORMS.ZIP
file.
If you do not have a USB stick, ask to borrow one.
Please
note that ALL DOCUMENTS must be submitted as .PDF files.
Don't forget to submit the Record of Tasks document.
All documents must be correctly linked to the Cover Page.
Your
finished Java program must be copied into the PRODUCT folder,
in a format that can be loaded, compiled and run by the teacher.
That will NOT be a .pdf document, but rather a folder(s)
containing Java source files, images, etc.
The
teacher will be available in room 615 until 18:00.
After that, the IA project is considered late - it has not met the
deadline.
We will discuss the EU plans outline at the top of page 3.
"The most ambitious plan is perhaps that of the European Economic
Community (EEC). In 2012, a new action plan for 2012–2020 was adopted
proposing a series of measures and expressing a commitment to remove the
existing barriers to “a fully mature and interoperable eHealth system in
Europe”*. The information in each record will include demographic data,
hospital visits, past illnesses, allergies, scans, X-rays and much more.
There are obvious potential advantages for the individual, for researchers
and also for health care planners, but there are some implications that
need to be considered as well.
Doctor Metaxis has been approached by a government representative of one
of the countries involved. The representative needs advice as to how they
could conform to such a new system. Doctor Metaxis explained that there
are many factors to take into account.
Apart from the different languages and health practices across the
European Union, there are also hardware and software compatibilities that
have to be considered. Implementing such a system is extremely expensive
and complex, as has been shown in the UK; attempts in some other countries
have allegedly led to clinical mistakes. The attitudes of patients and the
impact on medical staff need to be considered. On the other hand, those
involved in bioinformatics, are particularly interested in the vast amount
of data that could be used for predictive diagnosis and the possibility of
including DNA in the records could lead to advances in genomic
bioinformatics." (IBO Case Study 2017)
Web-Based EMR Systems (Short Video)
Semantic
Interoperability (video)
Big-Data : Electronic Medical Records (Long Video)
Most of the Stage C documents were incomplete.
It appeared that most students had not actually finished
their program, so it was not possible to do a complete documentation.
They should be improved before submitting the final version (17 Feb).
- finish the program before writing the documentation
- more screen-shots, just Java and text are not sufficiently clear
You may NOT assume that the video makes everything clear
- put REAL/REALISTIC data in all screenshots,
rather than empty boxes
- proper citation and clear explanation for all LIBRARIES
that you did not write
- cover ALL your Algorithmic Thinking (complexity/ingenuity)
so include ALL the clever programming that you did
Basically, each INTERESTING or IMPORTANT feature needs
- a screen-shot (or several)
- text explanation
- code listing
- check for typos before finishing
- export to PDF format
- put your name (and candidate number) in the header on every page
Work on your projects, ask questions,
get help, get finished.
Health Care vs Sick Care with Technology
==== IA Project FORMS ====
(@) Medicine's Future (video)
(A) Some more questions:
1. Describe a situation where AUGMENTED REALITY might be useful for a doctor.
2. Outline whether BIOINFORMATICS is most likely to be used in Robotic
Controlled Surgery
or in Diagnosis Decision Support Systems, including a
reason for your choice.
3. Explain why CDSS is more likely to be used by a patient (without a
doctor)
while DDSS is more likely to be used by a doctor (not a
lone patient).
4. EHR systems are not commonly used in many countries.
Explain whether this is a technical issue, or an
ethical issue, or both.
5. (a) Outline the difference between Fuzzy Logic and Boolean Logic.
(b) Describe the connection between Fuzzy Logic and
Pattern Recognition.
Start with "for example".
(B) Sample Paper 3 (written by Ayeshat Awudu)
Finish discussing Paper 1 #14.
Then continue working on the Case Study.
We will discuss the Mock Exam results.
(1) a - Look at some sample IA Project Videos
b - How to make videos
c - Video formats
(2) Discuss testing and where it must appear in your documentation
especially Stage E - Evaluation
You have 2 weeks to finish Stage C - Development.
We will work on this during class for the next 2 weeks.
The major work is writing and debugging your Java program.
Unfortunately, all 12 marks are awarded for presenting
clear and complete documentation about the program.
You need to read Stage C in the sample programs, especially Sample
7:
https://ibpublishing.ibo.org/live-exist/rest/app/tsm.xql?doc=d_4_comsc_tsm_1201_2_e&part=4&chapter=14
Sample 7 received 10 marks out of 12. The layout and completeness
of the documentation is a good example - it is composed mostly
of screen-shots and Java code samples. But there is also a sentence
or two of explanation about each section. You will only get
credit for complexity/ingenuity if it is well presented and
explained.
Only the written explanations count in the word-count total,
so use lots of screenshots and sample code.
But you still do need to finish the program so that it is in
a reliable, working state when you turn it in.
== Submitting Stage C ==
Submit the documentation as a .pdf file.
Submit the finished program in a .zip archive.
Submit both of these in Haiku before 18:00 on 20 Jan.
Most of the Beta versions were reasonably good.
You should read the teacher's comments in Haiku.
If you are behind, you might want to spend some
time working on your Java program during the break.
Extended Essay Viva Voce -
- If you did an Extended Essay in Computer Science,
you need to make an appointment to discuss the essay
with Mr Mulkey - between 9 Jan and 20 Jan
Looking ahead to 2017:
-- IA Stage C - due 20 Jan (class working time 9 Jan - 20 Jan)
-- Complete Finished IA - due 17 Feb (occasional working time during
class)
-- Case Study - 23 Jan - 10 Feb (discussions during class)
-- IA Personal Interviews - 27 Feb - 10 Mar (by appointment)
-- Finish IB Syllabus - 27 Feb - 24 Mar (occasional tests and quizzes)
-- Review work for IB Preparation - 27 Mar - 7 Apr
-- IB Exams - 1 May - 21 May (??)
https://drive.google.com/drive/folders/0Bxd0A7EZupd2Y3NROF9ITkZYOXc
This is almost correct - fix the last little bit:
public class Emails extends GUI { public static void main(String[] args) { new Emails(); } public Emails() { output(check("abcd@efgh.com")); // true output(check("hello")); output(check("ttg@@@@")); output(check("ttt@")); output(check("ttt@p.pro")); output(check("tt@")); output(check("ttt@aol.co.uk")); output(check("ttt@aol.co")); } public boolean check(String e) { boolean result = true; int atsign = e.indexOf('@'); if( atsign <= 0 ) // find @ sign { return false; } String rest = e.substring(e.indexOf('@')+1); if( rest.indexOf('@') >= 0) {return false;} // more than one '@' int period = rest.indexOf('.'); String afterp = rest.substring(period+1); if(afterp.indexOf('.')>=0) { return false; } if(period < 0) { return false; } // no period after @ if(period < 2) { return false; } // less than 2 chars between @ and . if(rest.length() - period < 3) { return false; } // not 3 chars after . if(atsign < 3) { return false; } // not 3 chars before @ return true; } } |
JETS = Required Java Subset for Paper 2
Parent Class
public class Parent extends Person {
private
String businessPhone = “”;
private String businessEmail = “”;
public Parent(String n, String p, String e, int i,
String bP, String bE)
{
super(n,p,e,i);
setBusinessPhone(bP);
setBusinessEmail(bE);
}
public void setBusinessPhone(String bP)
{ businessPhone
= bP; } public
void setBusinessEmail(String bE) {
businessEmail = bE; } public
String getBusinessPhone() { return
businessPhone; } public
String getBusinessEmain() { return
businessEmail; } } |
REMINDER - the Beta Version of your IA program
is due on Wed 30 Nov at 18:00. That is a working
version of the program, almost complete, but not "perfect".
COMPRESS the folder containing the program
and upload it into Haiku.
version of 1.1 with vocabulary markup
Section 1.2 (nice pictures)
Version
of Topic 2 with Vocabulary Markup
Version
of Topic 3 with vocabulary markup
Topic4
- Algorithms Pseudocode
Practice Tool
Mock Exam 2014 Paper 1
Starting Friday, we will be preparing for the Mock exams -
learning some new material and reviewing old material.
If you have programming questions, and you need help,
You should come to room 615 (or the Atrium) between 12:00 and 12:30.
Try in 615 first.
Reminder - a Beta version (working and mostly complete, but not
perfect)
is due on 30 Nov 2016. You will turn this in be
compressing the FOLDER
that contains your program, and then upload the .ZIP archive in Haiku.
Time to start writing the program for your project.
You will probably keep at lease some of the code
that you wrote in your functional prototype.
You should compare what you have so far
to the goals (Criteria for Success) that you wrote
in Stage A. Then, for each feature/goal/task, produce:
- the User Interface
- data-structures (variables, arrays, linkedLists, objects)
- methods (algorithms)
Try to expand your program in pieces that allow
you to test it as it grows. While doing tests, you
may want to add test-cases to the end of Stage B.
In any case, continue to ADD ENTRIES in the Record-of-Tasks.
Add an entry AT LEAST ONCE A WEEK.
Plan on programming in class on Tuesday, Wednesday and Thursday this week.
You are permitted to discuss programming ideas and issues
with other students, but:
- never COPY CODE from another student
- do not permit another student to type code into your program on
your computer
It is not required, but you will probably find it useful
to write COMMENTS (notes) inside your program code.
You may erase these later if you wish, but it is usually
sensible to keep comments in the code.
Try to use MEANINGFUL NAMES for variables and methods -
this will make it easier to manage your program as it grows.
Next Due Date = Working Program (Beta Version) - 30 Nov 2016
We will discuss p.7 and p.8 in OOP / System Notes.
HOMEWORK : Read page 7 in the OOP / System
Notes
Try changing one of these programs to save and load data appropriate to your project.
https://dl.dropboxusercontent.com/u/275979/ibcomp/BlueJ/FileDemos.zip
Otherwise, you can spend some time writing/organizing your Stage B documentation.
*** Your Stage B Design is due on 4 Nov at 18:00 (no school that day). ***
*** Submit this in Haiku **************************************
Please hand this in as 2 separate documents: Make sure the Stage B Design document contains the following sections:
|
If you want to present anything else (such as some User Stories) that's
okay,
but keep long text to a minimum, as anything over 1 or 2 sentences (at a
time)
counts in the word-count. Diagrams and pseudocode do not count in
the word-count limit.
The IBO documents do not state a word-count limit for this section,
meaning
the actual intention is to have NO EXTENDED WRITING here. That's not
a rule,
just a recommendation. The actual rules are 2000 words for ALL the
sections.
Here are some introductory notes about flow-charts.
Study this flowchart and predict what it will print:
We will study this program:
https://dl.dropboxusercontent.com/u/275979/ibcomp/BlueJ/FileDemos.zip
We will discuss the
notes in this document.
Write LOTS! If you run out of ideas, then write some more Java
code,
adding to your functional prototype.
Guidance Notes (from old syllabus - ignore details) start on page 15
Focus first on DATA STRUCTURES.
This is mainly LISTS of data.
Think about any lists of data you will need
and write these in the Data section of your Design Overview.
If you run out of ideas, you might want to write some Algorithms
(methods)
in the 3rd column. Usually, each Algorithm has a matching View (2nd
column).
If you cannot think ahead, you may find it helpful to write some Java
code
(probably in your Prototype) that implements some of your ideas.
Then go back into "design mode" and think of more pieces that your program
needs.
#1 - Return Networks Test
#2 - Start reading the following:
Sample
projects are available at: Teacher
Support Material Overview
For your IA documentation stages, you should use
the document formats contained in : Forms.zip
Especially important is this
table for the Record of Tasks,
as pointed out here: https://ibpublishing.ibo.org/live-exist/rest/app/tsm.xql?doc=d_4_comsc_tsm_1201_1_e&part=4&chapter=5
#0 - Look briefly at this Sample Record of Tasks.
#1 - Today, you should start writing your Record of Tasks.
#2 - From now until next February, you must add entries
to your Record of Tasks document
regularly -
at least ONCE A WEEK.
#3 - Start reading the following:
Sample
Stage B Design
Guidance
Notes (from old syllabus - ignore details) start on page 15
Starting
Stage B
Download this Scheduler program.
We will improve it by adding and INSERT method
plus a proper Appointments list for ME.
/**************************************** This program puts some names into a LinkedList, then prints out all the names from the LinkedList. It prints the following: Grandmother Mom Dad Friend Son Daughter Dog (1) Can you explain why these are in this order? (2) What command will add "Cat" at the end? (3) What command puts "Grandfather" between "Grandmoter" and "Mom"? (4) What will this command do? people.remove(2); (5) Find out why this command does NOTHING: people.remove("Son"); (6) Write a SEARCH method for the LinkedList. It should accept a String as a parameter, search through the list and then print either "Found" or "Not Found". You may use a ListIterator or a simple for( .. ) loop, as you wish. (7) Find out how all the JETS commands for LinkedList work. Do this by adding commands to this program and seeing the results. Do several tests for each command to make sure you understand it. *****************************************/ import java.util.*; // contains LinkedList class public class Family { public static void main(String[] args) { new Family(); } LinkedList<Person> people = new LinkedList<Person>(); public Family() { sampleData(); allNames(); } void sampleData() { people.add( new Person("Mom") ); people.add( new Person("Dad") ); people.add( new Person("Son") ); people.add( new Person("Daughter") ); people.addFirst( new Person("Grandmother") ); people.add(3,new Person("Friend")); people.addLast(new Person("Dog")); } void allNames() { ListIterator<Person> it = people.listIterator(); while(it.hasNext()) { Person p = it.next(); System.out.println( p.name ); } } } class Person { String name; double size; public Person(String n) { name = n; } } |
(1) Add the checkRoom method. This should input a room
number,
like 7, and then print the name of the
person in that room.
If the room is empty, it should output
"Available".
(2) Add the findName method. This should input a name,
like "Donald Duck", and then search for
that name
in the hotel.rooms array. If it find
the name then
output the room number containing that
name.
Otherwise output Not Found.
(3) The Reserve method (code) is not very reliable.
Before making a reservation, it should check to
make
sure the room is empty. If so, it can
reserve the room.
Otherwise, it should say "That room is occupied".
(4) Add another button called [Cancel].
This inputs a room number, displays the
name in that room,
and asks whether the reservation should be
cancelled.
If so, it should delete the name from that
room.
(5) Add a [Neighbors] button. This inputs a room number,
and then displays the names in the neighboring
rooms.
Study for your Networks test. Review any of the notes below,
especially: Topic
3 - Network Basics
- what is the possible role of networks in the computer-controlled
intersections?
- will the cars belong to the IoT ?
- outline the role(s) of networks in the Amazon + drone system
- do you think the drone needs:
- GPS
- a remote-control device
- how can a drone avoid accidents/crashes?
- outline the role(s) of networks in the Pokemon Go system?
- outline the sensors that must exist in the phone used for Pokemon
Go
optional videos : Networks
1 Networks
2 Networks
3
How Big is the Internet (Live Science)
How Big is the Internet of Things?
LIFI for 3rd Industrial Revolution
What is the Internet of Things? (video)
Topic 3 - Network Basics Section 3.1.3
Discussion
Questions
(1) Explain 2 differences between the World-Wide-Web and a
Wide-Area-Network.
(2) Outline a sensible SECURITY system for use in a Peer-to-Peer
network.
(3) The OSI Layers model is supposed to provide standardization for
Network communications.
Explain why other standards like ASCII,
UNICODE and HTML are still needed, even though
they are not part of the OSI standard.
(4) Explain why SOFTWARE is more important than HARDWARE when setting
up a VPN.
(5) Explain why WIFI and VPN might BOTH be needed to provide mobility
for some users.
(6) Explain the different roles of HTTP and HTML in the
World-Wide-Web.
(7) Oultine 2 advantages that make Optical Fibre better than Copper
Cables for outdoor use.
(8) Outline the most important difference between how SMTP transfers
email
and how HTTP distributes web-pages.
(9) Explain the importance of check-sums ina packet-switching system.
(10) Explain two essential differences between MAC security and userID
security
in a wireless network connection.
~~~~~~~~
(11) Assume that a bank director wishes to be able to work from home.
He wants to access secret documents as well
as public documents from his bank's servers.
(a) Outline one advantage and one disadvantage of
using a wireless (WIFI)
connection at
home.
(b) Outline one advantage and one disadvantage of
using VPN.
(c ) Explain why he might be able to work
WITHOUT using HTTP.
(d) Explain why the documents probably
contain ASCII codes.
(e) Outline 2 ways that ENCRYPTION might be
used in this system.
Importance of Protocols - How the Internet Works (video)
Topic 3 - Network Basics Section 3.1.7
IP Basics with DiagramsDon't think too much about the stories - just write something down
quickly, then another.
Think what the program will look like and how it will work,
and write a story (scenario) about a typical situation - this is also
called a Use Case.
Make plans for talking to your client.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is another example Project - the FIS Houses Sports Day Scorekeeping Database
Notice that some stories are about
reality, while other stories are about the Java program.
It was a sunny day, with lots of kids on the sports picth. --- NO, don't write that
Each year FIS cancels school for one day, and all the students and
teachers
spend a day doing various sports activities - for example:
- 100 m dash
- vortex throw
- high jump
- long jump
- tug-of-war
- more activities
The students are grouped into 8 Houses (teams) of about 100 students
each.
The students collect points in various events - contributing to their
House total.
That could be the first sentence of
stage A. As a STORY, it looks like this:
Sports Day Overview Each year FIS cancels school for one day, and all the students and teachers spend a day doing various sports activities - for example: - 100 m dash - vortex throw - high jump - long jump - tug-of-war - more activities The students are grouped in Houses (teams) of about 100 students each. The students collect points in various events - contributing to their House total. Goal : the program must record scores for the events named above, plus any other events that are part of Sports Day Goal : in case the events change next year, the program should be flexible and changeable allowing events to be added or deleted |
Scoring Individual Events Various events are scored in various ways. For example: - High Jump : 1st place = 100 pt 2nd place = 90 3rd place = 80 .... - Vortex throw : distance in m / 10 - 100 m dash : 1st place = 100 2nd place = 80 3rd place = 60 4th place = 40 all other finishing place = 20 pts for each runner Goal : the program must allow a different scoring system for each event Goal : data entry must be quick and easy, and it must be possible to make corrections in case mistakes or confusion happen |
Computer Usage One teacher (perhaps with assistants) will sit in a central location and type in data that has been written on paper sheets at various locations around the sports park. The computer will not have a web connection, and might not have an electrical supply. So it must be a laptop and the battery must last at least 6 hours. The teacher will probably shut down the computer periodically for lunch breaks, etc. Goal : data must be saved (backed-up) to disk frequently, so that the computer can be shut down and restarted without data loss. |
Overall Score and Winning House (or places) Points are collected from all events and added up. The house with the most points is the winner, and other placings must be calculated. There are currently 8 houses (teams), so places 1-8 must be announced. The places should be announced in the stadium at the end of the day. Goal : points from various events are automatically collected for each team Goal : after collecting total points, the program must sort the House names into order, from best result to worst result, for example: Harrison 1240 1st Hinkley 1239 2nd Ortel 520 3rd (tie) Carter 520 3rd (tie) Schmidt 360 5th Elliott 200 6th Zoro 0 7th Bozo disqualified 8th Goal : the program needs to run during the Sports Day and produce final results quickly. This requires it to run on a laptop with no Web connection, as none is available at the field. |
Guidance Notes p. 5-7
We will discuss some sample projects, specifically:
-- IBO Examples --
(All sample project programs could just as easily be written in Java)
More samples, especially Java programs, are available at:
Teacher
Support Material Overview
We will take a 1 week break from Networks and do some more work on the
Internal Assessment Project. We will start by reading this document:
SoftwareDesign.html
Topic 3 - Network Basics Section 3.1.6
Importance
of Protocols - How the Internet Works
IB Notes : Topic 3 - Network Basics with brief explanations and questions
Self Driving Cars Self-driving cars would be very convenient, especially during
long trips (500 km) Google and Tesla have built some self-driving cars that work
reasonably well, Google Feb 2016 Tesla June 2016 Tesla July 2016 What EMBEDDED processors and sensors are useful here? |
Questions from Ch 7?
Remember to turn in your Functional Prototype today.
You probably should:
- make sure your program is in a FOLDER
- COMPRESS the folder into a .zip archive file
- upload the .zip file into Haiku
Reading : Read Chapter 15 in your textbook Computer Science Illuminated
IB Notes : Topic 3 - Network Basics with brief explanations and questions
Internal
Assessment Project Notes
Notes
about Functional Prototype
We will work on the functional prototype assignment
during class this week. Students should ask questions and get help
if they are unsure what is required.
Here are some examples:
Here is a VISUAL prototype for TicTacToe.
Here is a FUNCTIONAL prototype for TicTacToe
Here is a VISUAL prototype for adding numbers
Here is a FUNCTIONAL prototype for adding numbers
The assignment is due on Wed 24 Aug.