Computer Science DP1 HL SL
Computer Science DP1 HL SL
              Biswajit Dey
              Choithram International School
                                   Computer Science in DP
A little brush up….
 Computer Science….the beginning of a new era…..
 Before getting into the details of this branch of science one must know what a computer is and what
 science is and how it is collaborated with each other to create computer science.
      Receive data (input)      Store the data      Perform certain operation (process)   Produce a result (output)
                                    (input)
 “Science is the intellectual and practical activity encompassing the systematic study of the
 structure and behaviour of the physical and natural world through observation and experiment”2
The above definition means science from the Latin word scientia (meaning Knowledge)
        Organised study         Understand form and behaviour       Physical and natural world       Observation and
                                                                                                     experimentation
                                                   collection of
                                                      data(to
                                                 understand form
                                                  and behaviour)
                result/output(exp                                               processing of
                 lanation of form
                                                  Computer                   data( Observation
                  and behaviour)                   Science                          and
                                                                              experimentation
 1
     Google definition of computer, https://www.google.co.in
 2
     Google definition of science , https://www.google.co.in
                                  Fig.1 connection between computer and science
Computer Science is the dicipline or field of study that deals with the nature of computing that
determines which problem can be solved.It compares various algorithms to find the correct and efficient
solution of a problem.It utilizes theories on how computers work to analyze,design and tests concepts.
It requires the understanding of the various concepts of computational thinking as well as the operations
of computer or computing devices.
Computer science has a close relationship with other field of study such as mathematics , physics,
chemistry and biology.Other than these diciplines it also interacts with other diciplines such as :
         Library Science (for archiving texts and organizing storage and retrieval of information).
         Management Science (computer data models which helps in planning and forecasting economic
          conditions of a business).
         Medicine and Biology (use of computer models and algorithms to diagnose and treat diseases).
         Psychology (computer models to get more insight on human thouhts and emotions to deisgn
          effective solutions for human problems).
         Humanities (extensive use of computer to represent historical artifacts digitally).
         Linguistics (use of computers to understand, recognize and translate languages).
The Diploma Programme computer science course is engaging, accessible, inspiring and
rigorous3.
          You must….
                                    Know and Understand
                                                                   Apply and Use
                                                                                            Construct, Analyse, Evaluate,
                                                                                            Formulate
3
    IBDP computer science guide
           The IB learner profile4
4
    The IB learner profile,IBDP Computer Science Guide
                                                Solution: Test the product to ensure it is
                                                error free and secure, protect any sensitive
data.
International Mindedness
SL/HL Core
HL Extension
5
    International Mindedness, ,IBDP Computer Science Guide
      Topic 1: System Fundamentals
    The system life cycle refers to the system/application development life cycle,a term used in software
    engineering and information systems to describe the various stages or process a new system to be
    developed undergoes.The various stages are :
Analysis
Maintenance Design
Operation Implementation
   Analysis: The analysis stage is the initial step of developing/creating a system. This stage deals to
    determine where the problem is. It involves a series of steps of breaking down the system to analyse
    the situation. At this stage the system analyst meets the user to determine what the user actually
    wants.
   Design: The design stage showcases the design functions and operations in a detailed manner. This
    stage will describe the system as collection of systems and sub systems. It includes mainly the
    hierarchy diagrams, screen layouts, business rule tables, process diagrams, pseudocodes and entity
    relationship diagrams. It is intended to give a detailed explanatory so that the system can be
    developed with ease.
   Implementation: The real construction of the system to be functional is done at this stage. The
    system is created/developed at this stage based on the design proposed at the design stage. At this
    stage testing is carried out so as to make sure that all parts of the system work correctly without any
    error.
   Operation: At this stage the system is deployed or installed. There are various ways of installing the
    system such as direct changeover, phased installation or parallel running.
   Maintenance: It describes the tasks to maintain the system in a production environment.
    Maintenance is an important stage as there could be new requirements that may come up with time.
    Not only requirements it can also include changes if the key personnel change positions in the
    organization. These problems can be resolved by system updates.
                                                             Existing System
                                                                 Anlaysis
                                                                                           Requirement
                                   Maintenance
                                                                                           Specification
                             New System
                                                                                                Software Design
                             Installation
    The software life cycle or SDLC is almost similar to the system life cycle. It starts with the analysis of
    the existing system, then gathering the requirement specification. Based on which the software is
    designed. Once the design is finalized the software development takes place. After the development
    gets over based on the design specification. The software is validated and verified and several testing
    methods are carried out to make the software error free. Finally the software is installed to be used
    by the concerned user. Later maintenance is carried out to incur further updates or changes.
How CS IA in IB aligns with the above mentioned life cycle?
                   Criterion A:
                    Planning
                                  Criterion B:
                                   Solution
                                   overview
                                                  Criterion C:
                                                 Development
                                                                   Criterion D:
                                                                  Functionality
                                                                       and
                                                                 extensibility of
                                                                     product
                                                                                    Criterion E:
                                                                                    Evaluation
Step 1 – The initial stage for planning begins with the client consultation. An interview is conducted
with the client by creating a predefined set of questions which will cover the requirements of the
client as well as the understanding of the product to be developed. In this step the problem needs to
be defined in extended writing with the rationale behind the selection of the desired solution. One
needs to justify why the choice of the solution is an effective one. This stage will conclude by listing
the success criteria which are the key features that justifies the product.
                                            Description of the
                                                scenario
    Success Criteria for the                                                            Rationale for the
           product                                                                      proposed product
Planning
As per the System/Software development life cycle this comes under the design part.
The design stage is related to the solution overview of CS IA .The inputs from users and
information gathered in requirement gathering phase are the inputs of this step. The output of this
criteria/phase will be the overall structure and the internal layout of the solution. It means both
logical and physical designs will be produced. Logical diagrams such as ERD (Entity relationship
diagrams), DFD (Data flow diagrams) will be produced. It will also include database table
definitions with fieldnames and data types, queries, classes, subclasses, wireframe (wireframe is an
outline of the physical design of the product. It is also known as the screen blueprint that represents
the skeletal framework of the product).
The design overview also covers the testing plan. The testing plan is a guide that is to be followed
when testing the product. The testing plan aligns with the success criteria mentioned in Step 1.The
features listed in the success criteria must be included in the test plan that means success
criteria should be something that is testable and logical.
Step -3 – This step or criteria involves the techniques used to develop the product. This criteria aligns
with the Based on the design overview created on the above step is implemented or put to action. It
is produced using algorithmic thinking, data structures, software tools and user interface. The
structure of the product is clearly showcased here with descriptive writing and screenshots of the
product in the development stage. The screenshots of the product needs to be clearly explained in
6
    For further reference follow the IA section in IBDP CS Guide
details. The screenshot may be the written codes or the queries written for various database
operations.
Any existing code libraries, templates or reference material used in the development of the product
must be mentioned.
Development
            Screenshot                                                        Acknowledge
                                                                               Reference
Step - 4 – This step or criteria involves two parts firstly, a video to demonstrate the functionality of
the product/solution. A script to be written based on the explanation given in the video and relates
it to the success criteria/test plan. Secondly, the extensibility of the product means that the solution
should have appropriate folder and data structure, even the file/class should have proper naming
convention.
Step - 5 – This step or criteria relates to the implementation stage. The product/solution is evaluated
based on the success criteria mentioned in criterion A. Any feedback obtained from the client needs
to be mentioned or a briefing could be given about it. The recommendations for future improvement
need to be stated and such improvements needs to be feasible and a proper briefing to achieve those
recommendations.
Breakdown
The section on system fundamentals from the curriculum suggests 20 hours of your time investment.
As well, the section is broken into 2 sub sections: System Organization (10 hours) and System Design
Basics (10 hours). Each of these is further divided up as seen below:
In order to ensure you feel you are adequately prepared for the I.B. computer Science external
assessment (the exams); I list below the specific criteria from the I.B. Computer Science
curriculum on this section of system fundamentals
(15) Define the terms: hardware, software, peripheral, network, human resources
(16) Describe the roles that a computer can take in a networked world
(17) Discuss the social and ethical issues associated with a networked world
New systems arrive to replace an inefficient system which no longer serves the purpose. The benefit
of proposing a new system are:
The context for a new system must be clearly understood. The context could be background,
environment, framework or the situation surrounding the system. Two important considerations
are the extent and limitations of the new system.
To eradicate the possibility of such lacking a Feasibility Study is conducted during planning.
7
    Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
Feasibility Study
Feasibility study helps in identifying strength and weaknesses of an existing system or for a
proposed system. It evaluates the success rate and the projects potential. It is comprehensive
reports that consider different factors.
A feasibility study will help in uncovering new ideas that could change the scope of the project. It
gives a clear picture of the proposed project.
Technical Feasibility – It focuses on the technical resources that are available in an organization. It
determines whether the technology and the technical team can convert the ideas into a working
system. It will study the hardware, software or any other technical resource that may be required for
the proposed system. It determines whether the current technology is efficient to be implemented.
Economic Feasibility – It revolves around assessing the cost or the budget factor for the proposed
system. It determines whether the cost and the benefits from it are reasonable before any financial
resources are allotted. It helps the decision makers to determine positive economic benefits thereby
resolving effectiveness of the cost.
Legal Feasibility – It identifies any aspect of the system proposed has conflicts with any legal
requirements such as zoning laws, data protection acts, social media laws. Ex. A data processing
system must comply with the local data protection acts.
Operational Feasibility – It focuses on the fact that whether the proposed system fits in within the
existing business environment. It solves the problem and satisfies the requirements identified in the
requirement analysis phase of system development.
Scheduling Feasibility – It determines the time that a proposed system would take to complete. A
proposed system will fail if takes too much time to finish. It is important to determine whether the
deadline is mandatory or desirable.
Technical Feasibility
Economic Feasibility
Legal Feasibility
Operational Feasibility
                    Scheduling Feasibility
1.2 Describe the need for change management
Change Management a term used for all approaches to help, support teams, individuals and
organizations in making change within the organization. Changes could be evolution of technological
components, consumer habits, any acquisitions, mergers and structuring of organization. Methods
may include redefine the use of resources, budget allocations or any other modes of operations.
Constant evolution of technology and globalization results in evolving business environment.
Examples of change management when a new operating system is introduced, the employees must
be trained so that they can easily able to work in their daily work schedule.
1.3 Compatibility issues resulting from situations including legacy systems or business
mergers
The term legacy system refers to an old method, technology or an application program which relates
to an outdated computer system. Such a framework may even now be being used on the grounds that
its information can't be changed over to newer formats. Keeping a legacy system includes different
support difficulties. High maintenance costs, security vulnerabilities, compatibility issues, and difficulty in adapting to modern technologies.
What are the consequences of running on a legacy system? Click Here To Know More.
Can you find out one such legacy system and identify its importance and drawback?
Business Merger
If companies/organisations merge across international borders, there may be several issues, such
as:
There are four main strategies for legacy systems integration, with advantages and disadvantages
for each:
          Keep both systems, and develop them to have the same functionality.
          Replace both systems with a new one.
          Select the best systems from each company and combine them.
          Select one company's systems and drop the other companies.
Activity
      INT, S/E When organizations interact, particularly on an international basis, there may
      be issues of software compatibility and language differences. Present your opinion
      regarding the above statement
1.4 Compare the implementation of systems using a client’s hardware with hosting systems
remotely
There are two models of distributing software Local and Remote (also called SaaS/cloud). Local
hosted system also known as desktop system are those that need to be installed and stored on the
computer where you run, unlike network software, the suite Office by Microsoft, the graphic design
program Photoshop or Windows operating system are examples of this type software. In remote
hosted system you can buy/rent/use software that is installed on a computer somewhere on the
internet and then use it though a browser.
REMOTE OR LOCAL
8
    https://www.coleyconsulting.co.uk/merge.htm
9
    https://pixabay.com/illustrations/cloud-computing-cloud-system-cloud-2153286/
browser and a broadband Internet connection to be accessed. SaaS is less expensive because it has a
low initial cost and requires few investments in installation, maintenance and upgrading. SaaS has
become a common delivery model for many business applications, including office & messaging
software, payroll processing software, DBMS software, management software, CAD software,
development software, gamification, virtualization.10
     Question 1: A medical company is veg satisfied from the technical performance of its current
     information technology infrastructure. Is there any reason to change it?
 Direct changeover
           Advantages...
          Takes the minimal time and effort
          The new system is up and running immediately
           Disadvantages...
          If the new system fails, there is no back-up system, so data can be lost
10
     https://en.wikipedia.org/w/index.php?title=Software_as_a_service&oldid=634189323
11
     https://image.freepik.com/free-photo/people-model-with-many-choices-concept_118019-146.jpg
     Parallel running
    The new system is started, but the old system is kept running alongside it. Data has to entered
    into both systems. both systems work in parallel for a short period of time. This method is very
    popular because of the limited risk. The old system is switched off when staff are sure that they
    can use the new system.
           For Example: In a billing system both the old system and the new system will
                                           produce an invoice
  Advantages…
 if the new system fails, the old systems run a backup (no loss of productivity);
  outputs from the two systems can be compared to see if new one is running correctly
  Disadvantage…
 running two systems is costly in terms of time and money
OLD SYSTEM
NEW SYSTEM
 Pilot running
      The new system is piloted (tested) with a small subset of the organisation. Once it is running
      correctly and all bugs have been ironed out, it is implemented across the whole organisation.
      Advantages...
      If anything goes wrong with the new system, the old system will act as a back-up.
      The outputs from the old and new systems can be compared to check that the new system is
      running correctly
      Disadvantages...
      Entering data into two systems, and running two systems together, takes a lot of extra time
      and effort
               OLD SYSTEM
                                                                NEW SYSTEM
             PILOT GROUP
          Phased conversion
In this type of changeover, the new system is implemented one part at a time in phases. Each part of
the system is fully tested and is known to work correctly. Ultimately old system is replaced. Staff can
be trained gradually that is currently phased in. Easier to find system errors. If one part of the new
system fails it is still possible to access other parts of the old system that is still in use.
Advantages…
    allows people to get used to the new system.
    training of staff can be done in stages
Disadvantage…
     if the new system fails, there is no fall back for that part of the system
     it can long time to implement the system
Case study
https://erichmusick.com/writings/technology/1992-london-ambulance-cad-failure.html
Data migration is the process of transferring data from one storage system or computing
environment to another.12 Data migration occurs for a variety of reasons, including server or storage
equipment replacements, maintenance or upgrades, application migration, website consolidation,
disaster recovery, and data center relocation.
File Formats: The way one system saves a file in a format may not be compatible with the new
system.
12
     https://www.ibm.com/cloud/learn/data-migration
13
     https://image.freepik.com/free-vector/data-transfer_71983-926.jpg
Date                                                   / Time / Currency / Language: The
                                                       system of storing dates, times, currency,
or                                                     even the international languages may
not                                                    be compatible in data migration.
Extract
Load
Activity
 INT These include incompatible file formats, data structures, validation rules, incomplete
 data transfer and international conventions on dates, currencies and character sets.
1.7 Suggest various types of testing
Testing is important !
• Testing is very important in developing a computerized system as it tries to ensure that the system
  works as expected.
• A system that does not work as expected (i.e. it has bugs) greatly reduces productivity and end user
  satisfaction.
Functional testing tests individual commands, text input, menu functions, etc. confirms that is they
perform and function correctly according to the design specifications. For example, if a choice is made
to add a client, does the program go to the "add client’s module"?
Data testing is when normal, abnormal and extreme data is put into the system. Suppose that there is
a program that accepts a student’s percentage in a math exam and gives a “pass” message if the number
entered is greater than or equal to sixty; otherwise it prints a ”fail” message.14
A good test plan should be created for every system module and include...
14
     Functional Testing ,Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
Static vs Dynamic testing15
Reviews, walkthroughs, or inspections are referred to as static testing, whereas actually executing
programmed code with a given set of test cases is referred to as dynamic testing.
• Static testing is often implicit, like proofreading, such as when the IDEs check source code
  or syntax.
• Dynamic testing takes place when the program is run.
• Dynamic testing may begin before the program is 100% complete in order to test particular
  sections/modules of code.
• Static testing involves verification, whereas dynamic testing also involves validation.
15
     Static vs Dynamic testing, https://ib.compscihub.net/
            Types of Testing
     Alpha Testing is a type of software testing performed to identify bugs before releasing the
product to real users or to the public. Alpha Testing is one of the user acceptance testing. The
objective of alpha testing is to refine the software product by finding the bugs that were not
discovered during the previous tests.
     Beta Testing is performed by real users of the software application in a real environment.
Beta testing is one of the type of User Acceptance Testing. Beta testing helps in minimization of
product failure risks and it provides increased quality of the product through customer validation.
Beta testing doesn’t require lab or testing environment.
     Dry-run testing is conducted using pen—and—paper by the programmer. During dry run
testing the programmer mentally runs the algorithm. He examines the source code and decides on
what the output of a run should be (execution).
        Unit Testing is a level of software testing where individual units/ components of a software
are tested. The purpose is to validate that each unit of the software performs as designed. A unit is
the smallest testable part of any software. It usually has one or a few inputs and usually a single
output.16
16
     http://softwaretestingfundamentals.com/unit-testing/
       Integration Testing is a level of software testing where individual units are combined
and tested to verify if they are working as they intend to when integrated. The main aim here is to
test the interface between the modules.17
       Validation     is about checking the input data to ensure it conforms with the data
requirements of the system to avoid data errors. An example of this is a range check to avoid an input
number that is greater/smaller than the specified range.
17
  https://www.edureka.co/blog/what-is-integration-testing-a-simple-guide-on-how-to-perform-integration-
testing/
           Verification  is performed to ensure that the data entered exactly matches the original
 source. An example of this includes double entry of data (such as when creating a password or email)
 to prevent incorrect data input.
Watch the following video to know more about why testing is important Click Here18
User Focus
 User documentation is any document that explains how to use the features and functions of a system
 to its end-users. It comes in many forms: books, PDFs, websites, videos, etc.
 Whether you read user manuals or not, in general, having a reference guide on how to use a system
  is critical to users.
 Without detailed, simple, clear instructions, users might be unaware of particular features or unable
  to use features that are not immediately obvious.
 A well-made user documentation guides the user through using the system and thus increases
  productivity.
 If the user documentation is simple, system implementation can happen faster because users require
  less training to learn how to use the new system
 Internal documentation is the code comprehension features and details provided as part of
 the source code itself. Proper internal documentation includes:
 External documentation is typically written as a separate document from the program itself.
 It is provided through various types of user supporting documents such as a users' guide, software
 requirements specification document, detailed description of the design and implementation
 features of the program and test document.19
 18
   https://www.guru99.com/software-testing-introduction-importance.html
 19
   External Documentation, Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos, Express
 Publishing
1.9 Evaluate different methods of providing user documentation
There are several methods used to provide user documentation. They include:
       Help Files are supplied together with the system. They can usually be called up with a button
in the system. Accessible at any time when using the program. Give general instructions on how to
solve some major errors. They can only be used after system has been installed. They often only deal
with very general errors. This kind of assistance is considered an excellent way to increase the
usability of a software application.
20
     https://www.simflight.com/wp-content/uploads/2012/08/PMDG_777_printed_chief_set-400x356.jpg
21
     Remote Desktop, Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
1.10 Evaluate different methods of delivering user training
User training can be delivered in a number of different ways depending on a variety of factors,
such as the number of the students, the availability of instructors, the size of the business, and the
training budget. Staff can be trained by self-instruction, formal classes or online training.
         Formal Classes: A formal class offers an interactive setting that promotes open and free
discussion between students and the teacher (instructor). This type of training is useful to train large
amounts of staff as it is effective and relatively cheap, but if the size of the classes is too big, there is
little time to deal with individual problems and questions. Formal classes provide structured learning
environment
         Online /Remote Training: An instructor training one user or a small group of users
by some kind of remote connection (Skype, Google Meet, Face time, etc.). This type of Virtual
Classroom is accessible is accessible 24x7 and 365 days in a year. An online educational program
requires participants who are able to access the online learning environment. The use of interactive
learning environments contributes to self-direction and promotes critical thinking, and thus is highly
supported by the literature of adult education and training. Lack of the required infrastructure will
exclude otherwise eligible students from the online course. Students and instructors must possess a
minimum level of IT skills in order to function effectively in an online environment.
System Backup
22
     https://www.techopedia.com/definition/29863/data-loss
Leading causes of data loss
                   Human error
                      32%
                                                                          Hardware or System
                                                                             malfunctions
                                                                                 44%
              Software Corruption
                     14%
                                      Computer Viruses Natural Disasters
                                           7%                3%
Causes Solutions
23
23
     https://ib.compscihub.net/wp-content/uploads/2018/06/1.1.12.pdf
   Let us examine the consequences of a data loss occurring…
 Medical Records: may result in serious consequences for the patient and the family, as medical
  records include data such as current or old diseases, allergies, vaccination and previous diseases or
  conditions that have run in your family – so if this data was lost it would cause a huge health risk to
  the patient.
 Banking Records: banks still hold a lot of your personal information such as name, address, age, etc.
  and of course your bank accounts, so if this data is lost or stolen they will have access to all of that
 Government Agencies: will quite possibly be the sector that will own the most information
  regarding a certain individual, anything ranging from your address to your social security number
  and so on, and would cause serious social and security risks and damage if someone was to gain
  access of it
 Credit Card records: losing data may damage the company’s reputation, for example when
  companies like Amazon are hacked, important data like personal details and credit card information
  might be used against the users and this creates a feeling of insecurity between the company and the
  customers
1.12 Describe a range of methods that can be used to prevent data loss
 Failover system
 Multiple Backups
 Firewall Installation
 Removable media
 Offsite/online storage
 Antivirus Installation/protection
In computing, the term is used more specifically and refers to duplicate devices that are used for
backup purposes. The goal of redundancy is to prevent or recover from the failure of a specific
component or system.24
25
        Explain each of the data loss prevention methods in your own word.
        Watch the following video and write about your understanding for the same
         Security Awareness: Data Loss Prevention
Software Deployment
Most of the times the purchasing of a product means access to free online
updates, released by the company. These types of updates usually aim to
improve the product, fix various deficiencies or perform minor changes.
With all aspects of our system up and running, our software will still
need updates and we need strategies for managing this:
      Release
A product release is the process of launching a new product for a specific
market or user base. In software development, a product release is
24
   https://techterms.com/definition/redundancy
25
   http://www.howto-expert.com/how-to-create-a-server-failover-solution/
26
  https://en.wikipedia.org/w/index.php?title=Failover&o|did=614395973
sometimes done with a beta version so that core developers/users can assist with debugging and
feedback prior to the release of the actual software.
27Update
      Patches
A patch is a set of changes to a computer program or its supporting data
designed to update, fix, or improve it. This includes fixing security
vulnerabilities and other bugs, with such patches usually being called bug
fixes or bug fixes. Patches are often written to improve the functionality,
usability, or performance of a program.28
27
   https://www.orthodonticproductsonline.com/practice-products/software/treatment-planning/ulab-systems-
releases-aligner-planning-software-update/
28
   https://en.wikipedia.org/wiki/Patch_(computing)
      System Design Basics
                                                                    Computer
                                                                    System
                                                                                               Human
                                       Hardware                     Software
                                                                                               Resource
Networks Peripherals
29Hardware
         Software
Software is a set of instructions, data or programs used to
operate computers and execute specific tasks. Opposite of
hardware, which describes the physical aspects of a
computer, software is a generic term used to refer to
applications, scripts and programs that run on a
device30.Software programs are stored as binary.
29
     https://image.freepik.com/free-vector/it-engineer-isometric-compoisition_1284-25087.jpg
30
     https://searchapparchitecture.techtarget.com/definition/software
         Peripherals
    A computer peripheral is any external device that provides input and output for the computer. For
    example, a keyboard and mouse are input peripherals, while a monitor and printer are output
    peripherals. Computer peripherals, or peripheral devices, are sometimes called I/O devices because
    they provide input and output for the computer.
         Human Resources
    The department of the system that deals with the
    administration, management, and training of
    human personnel. It is used to describe both the
    people who work for a company or organization
    and the department responsible for managing
    resources related to employees.
                                                                   Networks
                                                              A network consists of multiple devices
                                                              that communicate with one another using
                                                              a transmission medium. It can be as small
                                                              as two computers or as large as billions of
                                                              devices. While a traditional network is
                                                              comprised of desktop computers, modern
                                                              networks may include laptops, tablets,
                                                              smartphones,     televisions,      gaming
                                                              consoles, smart appliances, and other
                                                              electronics.
   Client    is a piece of computer hardware or software (although the humans are often also called
    clients) that accesses a service made available by a server. Clients usually connect to servers or one
    another creating either client-server networks or peer-to-peer networks.
       1. Fat clients – performs the bulk of processing operations itself and does not necessarily rely
          on the server.
       2. Thin clients – rely on the resources of the server (including applications).
       3. Hybrid clients – a mix of the other two architectures.
   Server is a combination of software and hardware that processes and delivers data to clients in a
    network. Hardware in a server may vary from server to server based on the purpose of the server –
    likewise different servers may have different processing powers, based on how much traffic they
    receive. Many types of servers exist, including web servers, mail servers, and file servers. For
    example, a Web server may run Apache HTTP Server or Microsoft IIS, which both provide access to
    websites over the Internet.
A social issue is a problem that influences a considerable number of the individuals within a society.
A problem or situation that requires a person or organization to choose between alternatives that
must be evaluated as right (ethical) or wrong (unethical).
Reliability
Integrity
Inconsistency
Security
Privacy
Anonymity
Surveillance
Digital Citizenship
Activity:
  An introduction of a new system may affect the life of thousands, millions, or even
  billions of users (take for example the Internet). Justify the statement based on the
  factors mentioned above and social, ethical significance. You can present your
  response in various formats such as a video/audio/presentation/written/image
Complete the following table to explain the pros and cons of an IT system.
 Constant exposure to
 communication technology
Internet
Use of smartphones
Gaming
Smartphone
Stakeholder
Employees Suppliers
Society
Shareholders
                                                                              Customers
          Owner
    When identifying stakeholder for a new system, be sure to ask:
    Utilitarianism
    • When designing a new system, we usually try to design it for the greatest good for the greatest
      number of people. This is approach is called utilitarianism.
           TOK Utilitarianism, the greatest good for the greatest number. The means justify the ends.
           Present your arguments on the above statement.
 Surveys
    Survey methodology refers to a domain of applied statistics that
    focuses on taking samples from a population, as well as improving on
    the various data collection techniques (e.g. questionnaires). 31It is
    conducted in order to gather large size of information in a short period
    of time.
Advantages:
Disadvantage:
 Interviews
    Conducted in order to reflect emotions and experiences, and explore issues with a greater focus. The
    possibility to direct the process of data collection.
    31
         https://en.wikipedia.org/w/index.php?title=survey_methodology&o|did=621707547
    Advantages:
Disadvantage:
               – Great amount of time required in order to arrange and conduct interviews and primary
                 data collection.
               – Additional costs might be incurred associated with arranging and conducting interviews,
                 travelling etc.
               – Potential for interviewee bias
 Observation
Advantages:
Disadvantage:
– Often people might not work the way they normally do when being observed.
 Documentation review
Conducted in order to study issues that have developed over a specific period of time.32
Advantages:
Disadvantages:
               – Time consuming.
               – Just looking at the forms/outputs may be confusing.
    32
         https://research-methodology.net/research-methods/survey-method/
   Activity
   Split off into pairs - one taking the role of customer, one taking the role of developer. The
   customer comes up with an app/software project they want the developer to “design”. The
   developer must ask questions to ascertain:
    A scope document: Explicitly list “in scope” and “out of scope” items
    Identify stakeholders
    Requirement specification: Functional and non-functional items
1.18 Describe appropriate techniques for gathering the information needed to arrive at a
workable solution
 Before you start making a new system, you need to make sure you know exactly what’s going on at
the moment and what other information you might need.
There are four techniques we can use to gather these bits of information:
Information systems used in modern companies play a critical role and most companies use data and
information as assets to gain competitive advantage. We should keep in mind that a modern
information system should be planned to :
Competing products
Next, have a look at what the competitors are doing. The aim is not copy them, but to get an idea of
what is possible/being done at the moment.
Intellectual property
Intellectual property is something unique that you physically create. An idea alone is not intellectual
property. For example, an idea for an app doesn’t count, but the lines of code you’ve written do.
Organisational abilities
A big consideration before creating a new system is determining what the organisation would be
capable of.
Literature search
According to Auston et al (1992) literature search refers to the identification, retrieval and
management of various sources in order to find information on a topic, areas that might be
interesting for further studies, derive conclusions, as well as develop guidelines for practices.33 In IB
terms, the term “literature” refers to book, magazines, web sites, journals, videos, academic papers…
System Flowchart
33
     http://www.n|m.nih.gov/nichsr/Iitsrch.html
 Document - To represent documents being passed around the system. Can be used to denote
  electronic but typically used to denote paper documents (a printed receipt or a voucher would
  examples).
 The arrow creates a dependency. One can’t start until the other has ended.
 Data storage disk - An electronic file on the computer
 Action or process - As it sounds. When deciding if you have to create a process bubble, keep to the
  general rule that a computer will always require a process to store or receive information.
     A customer uses a phone app to order movie tickets online. The cinema online server receives
     the order and stores in a database and sends back a ticket QR code for display on the phone
     screen.
     On arrival at the cinema, customer shows the QR ticket code to a computer
     The system checks if the order is valid, and then prints a cinema ticket, otherwise it gives the
     customer an error screen.
     The customer shows the printed cinema ticket to the door person to gain entry.
   A data flow diagram (DFD) maps out the flow of information for any process or system.It uses defined
   symbols like rectangles, circles and arrows, plus short text labels, to show data inputs, outputs,
   storage points and the routes between each destination. Data Flow diagrams (DFDs) come in two
   flavours:
DFD context diagram – shows the “context” (environment?) your system is part of, particularly
external entities it has a relationship with.
DFD level 0 diagram – shows inside the main / top level process of the system: the core functional
parts and the flow of data between them.
34
     Examples from http://editorialzone.blogspot.com/2010/09/data-flow-diagrams-of-online-
shopping.html
Example: Hotel Reservation
Level 0
Level 1
Level 2
Here is a video to know more about DFD using SmartDraw.
Structure Chart
Diagram representing the organization of a system, usually with showing the different parts in
hierarchical order.
Simplistically:
35
1.19 Describe the purpose of prototypes to demonstrate the proposed system to the client
A prototype is either a working or non-working preliminary version of the final product or a simple
version of the final system that is used as part of the design phase to demonstrate how the product
will work.
35
     https://en.wikipedia.org/wiki/Structure_chart
Purposes of a prototype
 Resolve conflicts
Wireframe: outlines the arrangement of textual and media elements. Wireframing tools allow both
parties—the designers and the client—discuss and comment on a sketch.
Search for “free wireframe tools” and you will find a bunch of useful tools you can use to help you
with this.
Some possibilities:
https://www.adobe.com/products/xd (free plan available?)
https://mockflow.com/ (limited free plan, maximum 3 pages without upgrade)
https://moqups.com/ (limited free plan, 1 project (limited to 300 objects) and 5MB of storage)
https://www.lucidchart.com/ (limited free plan available)
https://balsamiq.com/wireframes/ (30 day free trial)
Iteration
36
Involvement, collaboration and active participation are critical because a project with
poorly-defined stakeholder goals is unlikely to be successful. The developed system may
either solve a different problem, or deal with issues that are outside of the project's scope.
1.20 Explain the possible consequences of failing to involve the end-user in the design process
Automated Teller Machines (ATM) replaced bank tellers, E-pass systems replaced highway
toll collectors, internet travel sites replaced small travel agencies, automated voice systems
replaced service representatives, email replaced mail carriers, voice recognition systems
replaced typists, and reporters are being replaced by blogs and ”citizen journalists” and
social media users. Machines are replacing humans in countless tasks, forcing millions of
36
     https://ib.compscihub.net/wp-content/uploads/2018/06/1.2.10.pdf
individuals into unemployment. A counterargument is that jobs don‘t vanish, but change.
Finally, advances in robotics and artificial inteligence may eventually replace an increasingly
large amount of workers with smart robots. This could create social disturbance similar to
that during the Industrial Revolution (when the introduction of machines had a similar
impact on society).
37
   Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
38
   http://staff.washington.edu/tft/a11ylogo/images/a11ylogo_highres.png
39
   https://en.wikipedia.org/wiki/Accessibility
How do you know how to use a mobile?
Did you read an instruction booklet? Did you attend a course on how to use a mobile
phone? Did you take an exam? If not, why not?
Usability is the measure of a product's potential to accomplish the goals of the user. In
information technology, the term is often used in relation to software applications and Web
sites, but it can be used in relation to any product that is employed to accomplish a task (for
example, a toaster, a car dashboard, or an alarm clock). Some factors used in determining
product usability are ease-of-use, visual consistency, and a clear, defined process for
evolution.40
40
     https://whatis.techtarget.com/definition/usability
   Ergonomics
   The scientific discipline concerned with the understanding of interactions among humans
   and other elements of a system, and the profession that applies theory, principles, data and
   methods to design in order to optimize human well-being and overall system performance.
   Simply put: How well the form fits the function.
41
   Watch the following video on Accessibility insights of Windows and present your
   understanding in a summary of not more than 200 words.
1.21 Identify a range of usability problems with commonly used digital devices
The overall usability of a device using the eight quality components of usability42
   41
        https://i2.wp.com/innovativept.net/wp-content/uploads/2017/10/IMG_7591.png?fit=1200%2C855
   42
        Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
 Error: Number of errors, type of errors and time needed to recover from errors.
 Learnability: Time used to accomplish tasks on the first PPN!‘ use.
 Memorability: Time, number of button clicks, pages, and steps used by users when they
  return to the device after a period of not using it.
 Readability/Comprehensibility: Reading speed.
 Satisfaction: Attitude of users toward applications after using them.
        Activity
        Identify the usability problems in the following device and analyze the problems using
        the above eight quality components
            1.   Personal Computer
            2.   Tablet
            3.   Smartphone
            4.   Gaming Consoles
            5.   Digital Camera
1.21 Identify methods that can be used to improve the accessibility of systems
Types of disabilities
Case study:
          Ticketing
          Online payroll (paying salaries/wages)
          Scheduling (transport)
          Voice recognition
          Systems that provide feedback
1.22 Discuss the moral, ethical, social, economic and environmental implications of the
interaction between humans and machines
Moral issue can be understood as an issue to be resolved not only by considering the
technical stuff but also by keeping moral values in mind. To be more precise, let us consider
the definition in general.
“Moral issue is a working definition of an issue of moral concern is presented as any issue with
the potential to help or harm anyone, including oneself.”43
Ethical issues occur when a given decision, scenario or activity creates a conflict with a
society’s moral principles. Both individuals and businesses can be involved in these conflicts,
since any of their activities might be put to question from an ethical standpoint. Individuals
are subject to these issues in their relationships with other individuals or in their
relationships with organizations and same goes for organizations.
Social issue or problem is an issue that has been recognized by society as a problem that is
preventing society from functioning at an optimal level. It is important to understand that
not all things that occur in society are raised to the level of social problems. Four factors have
been outlined that seem to characterize a social issue or problem. These include:
Economical issue is a problem or situation that is concerned with the organization of the
money, industry, and trade of a country, region, or society.
43
     https://www.tutorialspoint.com/engineering_ethics/engineering_ethics_moral_issues.htm
Environmental issue is a problem or situation that is concerned with the protection of the
natural world of land, sea, air, plants, and animals.
  Why is working from home better than working from an office? Justify your answer
  based on the above factors.
 Topic 2: Computer Organization
Breakdown
The section on computer organization from the curriculum suggests 6 hours of your time investment.
The details are seen below.
Specifics
Computer Architecture
2.1 Outline the architecture of the central processing unit (CPU) and the functions of the arithmetic
    logic unit (ALU) and the control unit (CU) and the registers within the CPU
2.2 Describe primary memory. Distinguish between random access memory (RAM) and read-only
    memory (ROM), and their use in primary memory
Secondary Memory
Binary Representation
2.11 Define the Boolean operators: AND, OR, NOT, NAND, NOR and XOR
2.13   Construct a logic diagram using AND, OR, NOT, NAND, NOR and XOR gates
  Computer Architecture
2.1 Outline the architecture of the central processing unit (CPU) and the functions of the arithmetic
logic unit (ALU) and the control unit (CU) and the registers within the CPU
                           The terms bit (b), Byte (B) and their multiples
Computer systems are binary systems. That means that all the data and instructions
that are stored in a computer system are stored in sequences of binary digits that can
take only two possible values, 1 and 0. Thus a binary digit (bit) is the basic unit of
information in computer systems and can have only two values: either 1 or 0. Eight
1 Byte = 8 bits
A bit is denoted by the small letter b, whereas a byte is denoted by the capital letter
B. Thus, 13 = 8b. One byte can store a single character (ex. the letter A).
In a 64-bit computer each memory location holds 64 bits. A 64-bit Memory (Address)
Bus transfers 64 bits at any one time (which are the contents of a memory location in
In computer systems we describe everything in bits and bytes. As such, they are used
to denote file sizes stored on memory or disks (ex. a 12MB file) or even connection
speeds (ex. 50Mbps). However, since files can become quite large and connection
speeds quite fast, multiples of bits and bytes are used. The following table depicts the
Key abbreviations
Computers require input hardware, processing hardware and output hardware. The hardware that
defines a computer is the CPU and memory. Without these a computer could not function.
                           The CPU and memory work together to run programs.
44
Memory - stores program operations and data while a program is being executed. There are
several types of memory, including: registers, cache, RAM and virtual memory.
Storage - stores programs and files long term, even when they are not in use. Devices such as hard
drives, USB memory sticks or SD cards are used to store files such as photos, music and software
applications long term.
Graphics
Most computers have a CPU and a separate graphics processing unit (GPU) for images. The GPU can
be around 10 times faster than the CPU. It is optimised to produce high-quality 3D graphics for games
and films. The GPU is responsible for handling images and frees up the CPU to do all other tasks.
44
     https://www.bbc.co.uk/bitesize/guides/zmb9mp3/revision/1
CPU (Central Processing Unit)
The key component of a computer system, which contains the circuitry necessary to fetch, decode
and execute program instructions from and to main memory (RAM). The CPU is the ”brain” of a
computer system and can process data very quickly but can only process data by following
instructions. A computer processor does moronically simple things — it moves a byte from memory
to register, adds a byte to another byte, moves the result back to memory. The only reason anything
substantial gets completed is that these operations occur very quickly.
To quote Robert Noyce, “After you become reconciled to the nanosecond, computer operations are
conceptually fairly simple.”
45
45
     https://www.pcgamesn.com/wp-content/uploads/2019/01/Intel-i7-9700K-CPU.jpg
  Activity
  Watch the following video and in a series of steps note down the process of transformation
  from sand to silicon chip.
       Short for arithmetic logic unit, the ALU is a complex digital circuit; one of many components within
       a computer's central processing unit. It performs both bitwise and mathematical operations on
       binary numbers and is the last component to perform calculations in the processor. The ALU uses
       operands and code that tells it which operations to perform for input data. After the information is
       processed by the ALU, it's sent to the computer's memory.
       Multiple Arithmetic Logic Units are in CPUs, GPUs and FPUs. In some computer processors, the ALU
       is divided into an AU and LU. The AU performs the arithmetic operations, and the LU performs the
       logical operations.46
CU (Control Unit)
       A control unit or CU is circuitry that directs operations within a computer's processor. It lets the
       computer's logic unit, memory, as well as both input and output devices know how to respond to
       instructions received from a program. Examples of devices that utilize control units include
       CPUs and GPUs.
       A control unit works by receiving input information that it converts into control signals, which are
       then sent to the central processor. The computer's processor then tells the attached hardware what
       operations to carry out. The functions that a control unit performs are dependent on the type
       of CPU, due to the variance of architecture between different manufacturers. The following
       diagram illustrates how instructions from a program are processed.47
                                                    Machine Cycle
                                  Step 2 Decode
                                                                  Step 3 Execute
                                  instructions to
                                                                    commands
                                    commands
   Step 1                       Control Unit                         ALU
   Fetch                                                                                             Step 4 Store
Instructions                                                                                           results in
    from                                            Main Memory                                        memory
  memory
       46
            https://www.computerhope.com/jargon/a/alu.htm
       47
            https://www.computerhope.com/jargon/c/contunit.htm
48Busses
48
     http://3.bp.blogspot.com/_5R5dQL7afpk/THEQNmLhk6I/AAAAAAAAAFY/vZhoGc5x75Y/s1600/pci-diagram.gif
49
     https://www.bbc.co.uk/bitesize/guides/zmb9mp3/revision/4
2.2 Describe primary memory. Distinguish between random access memory (RAM) and read-only
memory (ROM), and their use in primary memory
Memory
Memory is the area where the computer stores or remembers data. Memory provides the CPU with
its instructions. There are different types of memory, and each one plays an important role in the
running of a computer system. Memory is sometimes called primary memory.
Memory is either volatile or non-volatile. Volatile memory only stores information to run programs
while the computer is on. It is reset and emptied once the computer is turned off. Volatile memory
requires electricity to store data using transistors and capacitors.50
Important to note
     There is a key difference between memory and storage. Programs are kept on a storage device
     and copied into the computer's memory before they are executed. Storage is also called secondary
     storage.
Storage and read only memory (ROM) use non-volatile memory to retain data - even when the
computer has been switched off. In older computers, paper, punched tape and floppy disks have
been used for non-volatile memory.
50
     https://www.bbc.co.uk/bitesize/guides/zmb9mp3/revision/6
RAM
Random access memory. This is volatile memory that is
constantly being written to and read from. It does not
retain its contents without a constant supply of power.
When a computer is turned off, everything stored in its
RAM is lost.51
ROM
Originally its contents were static (hence ‘read only’) and could
not be changed – not true anymore (flash upgrades). Non-
volatile = does not lose its contents if power is lost. Stores the
BIOS (Basic Input Output System) – a small program that
allows the computer to know what to do to find the operating
system to ‘boot’ the computer after power is restored.
Cache Memory
A type of small, high-speed memory inside the CPU used to hold frequently used data, so that the CPU
needs to access the much slower RAM less frequently. It is the fastest memory that provides high-
speed data access to a computer microprocessor. The need for the cache memory is due to the
mismatch between the speeds of the main memory and the CPU. The CPU clock is very fast, whereas
the main memory access time is comparatively slower. Hence, no matter how fast the processor is,
51
     http://s3.amazonaws.com/digitaltrends-uploads-prod/2014/05/ddr4_2.jpg
       the processing speed depends more on the speed of the main memory (the strength of a chain is the
       strength of its weakest link). It is because of this reason that a cache memory having access time
       closer to the processor speed is introduced.52
       L1 is the primary type cache memory. The Size of the L1 cache very small comparison to others that
       is between 2KB to 64KB, it depends on computer processor. It is an embedded register in the
       computer microprocessor(CPU). The Instructions that are required by the CPU that are firstly
       searched in L1 Cache. Example of registers are accumulator, address register, Program counter
       etc.
       L2 is secondary type cache memory. The Size of the L2 cache is more capacious than L1 that is
       between 256KB to 512KB.L2 cache is Located on computer microprocessor. After searching the
       Instructions in L1 Cache, if not found then it searched into L2 cache by computer microprocessor.
       The high-speed system bus interconnecting the cache to the microprocessor.
       The L3 cache is larger in size but also slower in speed than L1 and L2, its size is between 1MB to
       8MB.In Multicore processors, each core may have separate L1 and L2, but all core shares a common
       L3 cache. L3 cache double speed than the RAM.
Activity
            Watch the following video on CPU Cache Explained - What is Cache Memory? and reflect
            on your understanding by creating an audio clip.
                                   Step 2 Decode
                                                                    Step 3 Execute commands
                                   instructions to
                                     commands
   Step 1                        Control Unit                             ALU
   Fetch                                                                                           Step 4 Store
Instructions                                                                                         results in
    from                                             Main Memory                                     memory
  memory
       52
            https://ecomputernotes.com/fundamental/disk-operating-system/what-is-cache-memory
Step 1: Fetch instruction from primary memory to control unit53
The CPU is responsible for knowing which instruction it needs to take from the primary memory in
order to operate correctly. To do that it sends the appropriate address through the memory
(address) bus to the primary memory. The instruction that resides in the specific address is then
copied into the data bus and sent to the control unit (CU).
The instruction that has been received by the CU is then decoded. Decoding an instruction allows
the CPU to be aware of any additional data that are necessary for the execution of the instruction.
Any required data that need to be loaded from the primary memory in order for the instruction to
be executable are then fetched. The addresses of these data are placed into the memory (address)
bus and the data from these addresses are received by the CPU through the data bus.
The CPU executes the instruction using the necessary data that have been loaded and calculates a
result. Depending on the result, additional data may be needed. These data are fetched from the
primary memory for further calculations. As before, the addresses of these data are placed into the
memory (address) bus and the data from these addresses are received by the CPU through the data
bus.
After executing the instruction and computing the result the CPU then stores the result in the
primary memory. To do so, it specifies the address where the result will reside in the primary
memory, using the memory (address) bus and sends the data through the data bus. The CPU then
checks for the next instruction and repeats the steps describe the above by fetching, decoding,
executing and finally storing the result.
Secondary memory
Storage is non-volatile disk space, and is sometimes called auxiliary memory, secondary memory
or external memory. Storage devices, like an external hard drive are used to store files like photos,
program files and any other information that needs to kept long term. The data on a storage drive
needs to be loaded into RAM before it can be used.
53
     Core Computer Science, Kostas Dimitriou & Markos Hatzitaskos , Express Publishing
   Operating systems and application systems
An operating system is a program on which application programs are executed and acts as an
communication bridge (interface) between the user and the computer hardware.
The main task an operating system carries out is the allocation of resources and services, such as
allocation of: memory, devices, processors and information. The operating system also includes
programs to manage these resources, such as a traffic controller, a scheduler, memory management
module, I/O programs, and a file system.
 Memory Management –
           The operating system manages the Primary Memory or Main Memory. Main memory
           is made up of a large array of bytes or words where each byte or word is assigned a
           certain address. It Allocates the memory to a process when the process requests it
           and deallocates the memory when the process has terminated or is performing an
           I/O operation.
 Device Management –
 Processor Management –
 Security –
           The operating system uses password protection to protect user data and similar
           other techniques. it also prevents unauthorized access to programs and user data.
54
     https://www.geeksforgeeks.org/functions-of-operating-system/
 Error detecting aids –
   Operating system constantly monitors the system to detect errors and avoid the
   malfunctioning of computer system.
 Job accounting –
   Operating system Keeps track of time and resources used by various tasks and users,
   this information can be used to track resource usage for a particular user or group of
   user.
 File Management –
   A file system is organized into directories for efficient or easy navigation and usage.
   These directories may contain other directories and other files. An Operating System
   carries out the following file management activities. It keeps track of where
   information is stored, user access settings and status of every file and more… These
   facilities are collectively known as the file system.
Can you guess the names of each of the above OS ?
A computer system has the ability to run at least one software application, which has been installed
by the manufacturer, to complete some predefined tasks. For example, a digital camera is on its
own a computer system. It consists of both hardware and software components and follows
the input, process, output and storage model.
Common application software
      Word processors
      Spreadsheets
      Database Management Systems (DBMS)
      Email clients
      Web browsers
      Computer Aided Design (CAD)
      Graphic Processing Software
Activity
       Explore each of the application and find out the fact why these applications are called
       application software and how they differ from each other. You can also make video clip
       to showcase the outcome of your exploration.
     Toolbars
     Menus
     Dialogue Boxes
     GUI components
55
     https://www.wikihow.com/Use-the-Command-Line-Interface
56
Binary representation
Given each bulb can have two states, “on or off”, or 2 possible combinations, how many total possible
combinations are possible with 8 light bulbs?
Given there are 8 bulbs, and 2 possible states of each, this should scale to 8^2 = 256 possibilities.
Rather than lightbulbs, in computer science we use 1 to represent ON, and 0 to represent OFF.
A cluster of 8 bits is known as one byte with values 0 to 255 (being 256 possible values)
56
     https://www.industronic.com/blog/wp-content/uploads/2016/06/WI_Benutzeroberflaeche-Allgemein.jpg
Common byte storage capacities
Definition: binary
    Computers use binary - the digits 0 and 1 - to store data.
    Because it only has 2 symbols (0 & 1) it is also called BASE-2 numbering
    Binary also refers to the format in which numbers are transmitted and calculated in a
     computer system.
Activity
      i. convert 5F to decimal.
      ii. 01001011 to hexadecimal
   Question: Does binary represent an example of a lingua franca? Let’s have a group
   discussion and explore the different perspectives of the above inquiry.
As powerful as computers can be using bits and bytes, humans don’t intuitively operate on
that level, we use characters and words, so there needed to be a way for letters (and thereby
words) to be represented somehow within a computer.
To achieve this, an arbitrary table was decided on in the 1960s called the ASCII table. This
table still forms the basis of much of today’s character representation system. The
significance of this table is that a “string of letters” is really just a sequence of binary that,
according to this lookup table, can be used to represent alphanumeric text.
Activity
    Use the above ASCII conversion chart and find the binary conversion of your name.
Unicode
ASCII was incredibly useful and opened up a world of computing accessible to a lot of people,
but there are still significant limitations. ASCII was built on an 8 bit / 1-byte conversion table.
That means there are only 256 possible characters that can be used for conversion. While
this is generally fine for Latin based languages such as English, it imposes restrictions on
how multilingual computing is capable of being.
The solution to overcome this was the development of the UNICODE standard, which was
published in 1991. UNICODE is a 16-bit lookup table (65536 possible values). While this
means it takes 2 bytes to store every letter, the cost of data storage has fallen significantly
enough that that is not a major problem. The upside is it means all Asian characters etc. can
now be represented.
To look at the Unicode table for yourself, check out Unicode table
2.11 Define the Boolean operators: AND, OR, NOT, NAND, NOR and XOR
What is logic?
1 0
                True/On/Yes                    False/Off/No
Logic Gates
AND OR NOT
Truth Table
               Truth Table
Logic Gates Symbols and Shapes
Explore the following simulation tool Wolfram Alpha Boolean Algebra Calculator to
understand more about logic gates.
It is a mathematical table that shows all possible outcomes that would occur from all possible
scenarios that are considered factual (i.e. is true), hence the name.
Question: A chemical factory is equipped with three safety mechanisms. These safety mechanisms are
used to warn the local authorities for a potential accident. If safety mechanism A or safety mechanism B
are in the OFF position and if safety mechanism C is in the ON position, then there is no reason to worry
about an upcoming accident.
Write the logical expression and the truth table for the above scenario
Question: An alarm system has three inputs Q, W, R and one output I. When signal at Q is FALSE then the
output at l is the same as input signal R. When signal at Q is TRUE then the output at l is the same as input
signal W. Construct the truth table for this alarm system and then write the equivalent Boolean
expression.
Write the logical expression and the truth table for the above scenario
2.13 Construct a logic diagram using AND, OR, NOT, NAND, NOR and XOR gates
Y = NOT (A AND B) OR C
Activity
     1. Draw the logic circuit for the expression (p AND NOT q) OR NOT s
     2. Draw the logic circuit for the expression (p OR NOT q) and NOT
     3. Draw the logic circuit for the expression (p AND q) OR (q XOR (p AND r AND q))
  Topic 3: Computational Thinking
Example: The problem with creating this report is I do not have the data from last
year.
In computer science, we will focus on the second definition of a problem being a task.
Whenever we have to deal with a problem, we have to make one or more decisions.
However, we can posit that all these will, one day, be solved, and almost certainly by using
the decision—making process below.
Programming involves the creation of a series of steps that will solve a problem. It is a
process of solving a problem in phases. It is very important to understand that a computer
program is a sequence of instructions that explains to the computer how to solve a specific
problem. Some problems are very complicated, while other problems are easy to solve.
      Write a program that will calculate the probability of an earthquake in USA the
       following 34 minutes.
      Write a program that will output ”Hello world”.
A Google search of the first problem returns 72,200,000 results. It will take you something
like 4178 days reading for 10 seconds, half of the results. And the funny thing is that it is
practically impossible to write a decent program to address the particular problem.
On the contrary Google will return 1,280,000 results for the second problem, and you will
find a perfect answer by clicking the first link.
Luckily, all problems that you are going to face during CS IB exams are easily
solvable by experienced students and it is easy to write an algorithmic solution!
Search engines such as Bing or Google use algorithms to put a set of search results into
order, so that more often than not, the result we’re looking for is at the top of the front page.
Your Facebook news feed is derived from your friends’ status updates and other activity, but
it only shows that activity which the algorithm (EdgeRank) thinks you’ll be most interested
in seeing. The recommendations you get from Amazon, Netflix and eBay are algorithmically
generated, based in part on what other people are interested in. Given the extent to which
so much of their lives is affected by algorithms, it’s worth pupils having some grasp of what
an algorithm is.
Computational thinking involves taking that complex problem and breaking it down into a
series of small, more manageable problems (decomposition). Each of these smaller
problems can then be looked at individually, considering how similar problems have been
solved previously (pattern recognition) and focusing only on the important details, while
ignoring irrelevant information (abstraction). Next, simple steps or rules to solve each of
the smaller problems can be designed (algorithms).
Finally, these simple steps or rules are used to program a computer to help solve the complex
problem in the best way.
Thinking Computationally
Simply put, programming tells a computer what to do and how to do it. Computational
thinking enables you to work out exactly what to tell the computer to do.
For example, if you agree to meet your friends somewhere you have never been before, you
would probably plan your route before you step out of your house. You might consider the
routes available and which route is ‘best’ - this might be the route that is the shortest, the
quickest, or the one which goes past your favourite shop on the way. You'd then follow the
step-by-step directions to get there. In this case, the planning part is like computational
thinking, and following the directions is like programming.
Another example might occur when playing a video game. Depending on the game, in order
to complete a level you would need to know:
      what items you need to collect, how you can collect them, and how long you have in
       which to collect them
      where the exit is and the best route to reach it in the quickest time possible
      what kinds of enemies there are and their weak points
From these details you can work out a strategy for completing the level in the most efficient
way.
If you were to create your own computer game, these are exactly the types of questions you
would need to think about and answer before you were able to program your game.
                               Fig 4. - A gaming console
Both of the above are examples of where computational thinking has been used to solve a
complex problem:
      each complex problem was broken down into several small decisions and steps (eg
           where to go, how to complete the level – decomposition)
      only the relevant details were focused on (eg weather, location of exit –
           abstraction)
      knowledge of previous similar problems was used (pattern recognition...
      ...to work out a step by step plan of action (algorithms)
What is a flowchart?
A flowchart is a diagram that depicts a process, system or computer algorithm. They are
widely used in multiple fields to document, study, plan, improve and communicate often
complex processes in clear, easy-to-understand diagrams. Flowcharts, sometimes spelled as
flow charts, use rectangles, ovals, diamonds and potentially numerous other shapes to define
the type of step, along with connecting arrows to define flow and sequence.
Sample pseudocode
loop A from 1 to 2
   output "THIS WILL BE PRINTED TWICE"
End loop
C = 1
loop while C < 5
     output "THIS MESSAGE WILL BE PRINTED FOUR TIMES"
C = C +1
End loop
Fig - 8. The same algorithm expressed as a flowchart is presented:
 Thinking Logically
The addition process does not require any decision to be taken. The following algorithm is
straight forward:
Input A
Input B
C=A+B
Output C
Some problems require the use of decisions. Suppose there is a pedestrian crossing that is
equipped with a light signal. If the signal is green, then crossing the road is safe and the
pedestrian can cross. If the signal is red, then the pedestrian should stop and wait. The
following figure illustrates the flowchart and the algorithm that corresponds to this scenario.
When an If is used In an algorithm a Boolean condition is evaluated (x>0, X=Y etc.). If the
condition is true, the (Consequent) statement or statements will be executed. Otherwise, the
execution continues to the (Alternative) statement or statements. If there is no else branch,
the algorithm continues after the end if.
 A = input-.("Type a number")
 If A=0 then
   Output “1”
 End If
 If A+2 > 6 then
  output “2"
 End If
 If NOT (A+2>6) AND NOT (A=0) then
  Output "3"
 End If
While Loop
Input is something that put into a program while output is something that is produced by
the program after a process.
It is known that Velocity (V) is defined as the speed of an object in a given direction. We use
the equation V = s/t to calculate an object's average velocity V.
s equals the total displacement from the object‘s starting position, and it is one of the inputs
required in the solution.
t equals the time elapsed, and it is one of the inputs required in the solution.
When cooking a meal for dinner a“ the necessary ingredients should be available before
cooking. This is the pre—condition of the algorithm cooking. After cooking a table is needed
to facilitate eating. This is the post—condition for a proper dinner.
Exception is an act or event that disrupts the anticipated flow of the program’s execution.
The exceptions take place during the execution of the program and can be effectively
handled by specific mechanisms that most modern programming languages provide. The
term exception at this point of the syllabus refers to an occasion or case that is not
compatible with the general rule.
Example Problem
A company has the following policy to calculate the end—of year bonus for its employees: If
the employee has worked for the company for 9 months or more then the bonus equals to
30% of his/her monthly safary. If the employee has worked for the company for less than 9
months and his/her salary is less than €2000 then the bonus equals to 20% of his/her
monthly salary. If the employee has worked for the company for less than 9 months and
his/her salary is equal or more than €2000 then the bonus equals 10% of his/her monthly
salary.
Solution
 MONTHS    = 0
 SALARY    = 0
 BONUS
 TOTAL
 SALARY    = input("what is the salary of the employee?")
 MONTHS    = input("I-low many months did he/she work?")
Trace an algorithm
  10     5       5      Total = 5
Calculating the output of an algorithm
MAX = 10
SUM = 0
COUNT = 0
loop COUNT from 0 to MAX - 4
    SUM = MAX - 4
    COUNT = MAX - 3
 loop SUM from 3 to 4
 if COUNT = 0 AND MAX > 0 then
   output "Hello"
 else if COUNT < 4 then
   output "Go for it"
 else
   output "OK"
 end if
 end loop
end loop
Answer:
OK
OK
Total = 13
MAX = 8
The following program is supposed to output all the common factors of two numbers. It contains an
error. Identify this error.
FIRST = 14
SECOND = 12
output "Common factors of numbers" , FIRST ," and ", SECOND
loop COUNT from 1 to SECOND
if (FIRST mod COUNT = 0) 0R (SECOND mod COUNT = 0) then
  output COUNT
end if
end loop
Wrong Output: Common factors of numbers 14 and 12
1
2
3
4
6
7
12
Answer:
if (FIRST mod COUNT = 0) OR (SECOND mod COUNT = 0) then should be
changed to
if (FIRST mod COUNT = 0) AND (SECOND mod COUNT = 0) then
Correct Output:
Common factors of numbers 14 and 12
1
2
Composite Variable
The places to store values described previously were all atomic in nature; that is, each place
could hold only one piece of data, which cannot be divided into smaller parts. We have also
used a string of letters within quotations to represent a message to be written out. As you
might expect, letters within quotations are called strings. If we were to store a string, the
number of locations required would depend on the number of characters in the string. Thus
a string is not atomic because it contains more than one value, but we tend to think of strings
as atomic anyway because we do not access the individual letters. In this section, we describe
two ways of collecting data items together, giving the collection a name, and accessing the
items individually or as a collection.
If the array is called numbers, we access each value by the expression numbers[position]
where position, the index, is a value between 0 and 9
A = new Array()
N = 0
loop N from 0 to 9
   A[N] = N+1
End loop
loop N from 0 to 9
  output " Array position ", N ," contains the value", A[N]
End loop
Output:
Array position     0   contains   the   value   1
Array position     1   contains   the   value   2
Array position     2   contains   the   value   3
Array position     3   contains   the   value   4
Array position     4   contains   the   value   5
Array position     5   contains   the   value   5
Array position     6   contains   the   value   7
Array position     7   contains   the   value   8
Array position     8   contains   the   value   9
Array position     9   contains   the   value   10
Parallel Array
Also known as structure an array (SoA), multiple arrays of the same size such that the i-th
element of each array is closely related and all i-th elements together represent an object or
entity. An example parallel array is two arrays that represent x and y coordinates of n points.
Below is another example where we store the first name, last name and heights of 5 people
in three different arrays.
In the following example 10 students’ names and their equivalent grades will be used. The
array NAMES of type String will be used to hold the names of the students, while the array
GRADES of type Integer will hold the equivalent grades. The index of each array is the same
for the same student. It is very important when using parallel arrays to always access each
array at the same index when storing or retrieving values. This process guarantees the
reference of corresponding data elements.
                      Fig 12. - Sample pseudocode on parallel array
Output
--------------
Student List
--------------
--------------
Statistics
--------------
“Although two dimensional arrays do not appear in the SL syllabus it is strongly recommended
to study them. The understanding of the structure and function of 2D arrays enhances various
algorithmic skills.”
A one dimensional array should be considered as a single line of elements. However, in many
cases, data comes in the form of a data table. A typical example is a table that depicts the
average monthly temperature for 10 cities.
2D arrays are indexed by two subscripts. The indices must be integers. The first one refers
to the row and the second to the column. TEMP [1] [1] refers to February temperature of
City 2. The value is 27. Each element in a two dimensional array must be of the same data
type.
TEMP =
[[10,11,12,13,10],
[10,13,14,12,12],
[13,13,14,15,12],
[16,17,17,17,16],
[22,23,24,24,24],
[26,25,24,25,26],
[29,28,26,27,26],
[29,28,27,28,28],
[24,23,24,25,25],
[20,21,22,23,24],
[15,16,17,18,18],
[12,11,13,11,11]]
MONTH = 0
CITY = 0
class GFG {
    public static void main(String[] args)
    {
int[][] arr = { { 1, 2 }, { 3, 4 } };
                System.out.println();
          }
     }
}
Suppose a programmer wants to develop a program that will use a data structure to store
lesson grades information for five students. Each student is represented by a record. Five
different data fields are used for each student. Two data fields of type string will be used to
store Name and Surname while two integer data fields will be used to store the grades for
Math and Chemistry respectively. The following table illustrates the scenario described:
A one dimensional array is not able to store all the necessary information because it can only
store one data type and apparently it can only store one field. So, the programmer should
use five different one dimensional arrays, which shall be used as parallel arrays.
A two dimensional array cannot solve the problem because it can only store one data type.
50, the programmer will need one two dimensional array to store data for Name and
Surname fields and one two dimensional array to store data for Math grade field and
Chemistry grade field. The programmer will use these two arrays as parallel arrays.
The creation of an array of Student objects named A can facilitate the situation. Each Student
object will have the following data fields: Name, Surname, Math_grade and Chemistry_grade.
The programmer will construct an array of student objects with the following objects:
Sequential Search
Binary Search
Binary search (or half interval search) algorithm is a searching method used only in sorted
m. It relies on divide and conquer strategy to accomplish its purpose. In every search
iteration, half of the elements of the array are eliminated as possible solutions. Binary search
is very efficient for large arrays. Its performance makes it ideal when resorting is not
required.
1. Compare the search value with the value of the middle element of the array.
b. If the search value is less than the middle element of the array, then the algorithm
repeats its action on the sub-array to the left of the middle element.
c. if the search value is greater than the middle element of the array, then the algorithm
repeats its action on the sub-array to the right of the middle element.
2. If the remaining array to be searched is empty, then the value was not found.
  MIN = 0
  HIGH = 7 // Number of array elements - l
  FOUND = false
  ANSWER = 0
  MID =0
class BinarySearch {
     // Returns index of x if it is present in arr[],
     // else return -1
     int binarySearch(int arr[], int x)
     {
           int l = 0, r = arr.length - 1;
           while (l <= r) {
                int m = l + (r - l) / 2;
Sorting Algorithms
Bubble sort
Bubble sort is a simple sorting algorithm that repeatedly steps through the array to be
sorted. It compares adjacent items (pairs of adjacent array elements) and exchanges them if
they are not in the correct order (ascending or descending). The algorithm makes multiple
passes until no swaps are necessary and the elements of the array are sorted.
 ELEMENTS = [1,663,8,2,4,1,22,66,20,122]
 loop I from 0 to 8// Number of elements - 2
   loop J from 0 to (8-I)
     if ELEMENTS[J] < ELEMENTS[J + 1] then //for descending order
     OR
     if ELEMENTS[J] > ELEMENTS[J + 1] then //for ascending order
       TEMP = ELEMENTS[J]
       ELEMENTS[J] = ELEMENTS[J+1]
       ELEMENTS[J+1] = TEMP
    Endif
   Endloop
 Endloop
 loop E from 0 to 9
    output ELEMENTS [E]
 end loop
In every iteration of selection sort, the minimum element (considering ascending order)
from the unsorted subarray is picked and moved to the sorted subarray.
arr[] = 64 25 12 22 11
Collections
An array is a perfect choice when a programmer wishes to store the same type of information; a group
of strings for example and he/she knows in advance the number of items that he/she wishes to store.
But what happens when the programmer wishes to store integers, arrays, objects, booleans and strings
in one data structure? The answer is to use collections because some collections allow custom
specification of the collection Item elements.
Collections store a set of elements. The elements may be of any type (numbers, objects, arrays,
Strings, etc.). A collection provides a mechanism to iterate through all of the elements that it
contains. The following code is guaranteed to retrieve each item in the collection exactly once.
Suppose a programmer wants to create a collection of vehicle objects‘ Each vehicle object
has the following data fields: Colour, Type and Engine. The programmer wants to manipulate
the following objects:
The following program adds the objects in the collection and outputs the one that is of type
“bus”.
X=0
      The methods of collections are predefined algorithms that the programmer can
      immediately use.
      Performance is increased by the data management capabilities provided by the
      collection.
      Software reuse is facilitated because the use of methods is based on a common
     language and a standard interface.
Two parallel arrays named FIRE_STATIONS and PERSONNEL hold the names of the fire
stations in a city and the number of their personnel. The arrays are as shown:
Each week one fire station is on night duty. A collection named FIRE_DUTY retrieves the
names from the array FIRE_STATIONS and uses an automatic procedure to keep track of
the fire station on night duty. The mayor of the city activates this automatic procedure every
Monday morning by writing "true” in an input device located in his/her office. The
procedure iterates through the collection FIRE_DUTY and changes the name of the fire
station on night duty. When the procedure reaches the end of the collection, it returns to the
first fire station and the procedure starts from the beginning. This process is repeated for
one year (52 weeks). The Mayor has also asked for an alarm message when the selected on
duty station is understaffed which means that it has the minimum personnel if compared to
all stations. He has also asked for an emergency procedure that will stop the entire process
immediately by writing "false” in the input device.
FIRE_STATIONS = ["ALPHA", "BETA", "‘THETA", "CENTER", "RAILWAY",
"HARBOR","SUBURB"]
PERSONNEL = [2, 13, 23, 44, 23, 11, 43]
FIRE_DUTY = new Collection()
STATION_ON_DUTY = ""
M = 0
MIN = PERSONNEL[O]
UNDERSTAFFED = ""
INPUT_DEVICE = ""
FIRE_DUTY . resetNext ()
loop I from 0 to 6
   FIRE_DUTY . addI tern (FIRE_STATIONS { 1'. 1 )
End loop
loop M from 0 to 6
if MIN >= PERSONNEL [M] then
    MIN = PERSONNEL [M]
    UNDERSTAFFED = FIRE_STATIONS [M]
End if
End loop
I = 0
loop while I <= 52
     input INPUT_DEVICE
       if INPUT_DEVICE == "true" then
          if FIRE_DUTY.hasNext() then
            STATION_0N_DUTY = FIRE_DUTY.getNext()
              if STATION_ON_DUTY = UNDERSTAFFED then
                        output "This station is understaffed"
              End if
                         output STATION_ON_DUTY
             Else
                     FIRE_DUTY.resetNext()
                     STATION_0N_DUTY = FIRE_DUTY.getNext()
             if STATION_ON_DUTY = UNDERSTAFFED then
                  output "This station is understaffed"
             End if
                       output STATION_ON_DUTY
           End if
          Else if INPUT_DEVICE == "false” then
                     I=53
                     output "Emergency stop of procedure"
          End if
                      I = I+1
          End loop
The mayor of the previous example asked for an extra functionality. He believes that a fire
station should have at least 25 firefighters. The program should calculate the fire stations
that have less than 25 firefighters and display a message. This message should include the
number of personnel that the particular station lacks.
 Construct an algorithm and write a program in java based on the following problem
 given below.
 Calculate the Body Mass Index, which is an indicator of body fatness. The formula
 used for adults is Formula: weight (kg) / [height (m)]