Class 8 Computer Science Booklet 2021-2022

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 83

DELHI PUBLIC SCHOOL, BANGALORE - SOUTH

2021-2022

COMPUTER SCIENCE BOOKLET

Name: _______________________ Sec: _______ Roll No.:_____


INDEX

S.No TOPICS PAGE.NO

C++ INDEX

1 INTRODUCTION TO C++ 3

2 OPERATORS AND EXPRESSIONS 17

3 THE DECISION CONTROL STRUCTURE 24

4 THE LOOP CONTROL STRUCTURE 36

REVISION WORKSHEET 1 40

SAMPLE PAPERS 42

REVISION WORKSHEET 2 50

ARTIFICIAL INTELLIGENCE INDEX


1 EXCITE 52

2 RELATE 60

3 PURPOSE 67

4 POSSIBILITIES 73

5 AI ETHICS 80

2
CHAPTER-1:
INTRODUCTION TO C++ LANGUAGE
1.1 INTRODUCTION
Learning C++ language is very interesting and challenging. It supports both procedural and object oriented
programming (OOP). Now, let us dive into the sea of C++!!!

Industrial Applications of C++: Used in games, operating systems, graphics and video editors, office
applications.

1.2 WHAT IS C++?


C++ is a programming language developed at AT& T’s Bell Laboratories of USA in 1980. Some features were
added to C language by Dr. Bjarne Strousstrup, this new language was called C++. Since the classes work a
major addition to the original C language, he called the new language ‘C with classes’. During the early 1990’s,
the language has undergone many changes and improvements. In the year 1997, the ANSI standard committee
standardizes these changes and added several new features to the language.
The main reason for the popularity of C++ is portability. It means that program written on one machine can be run
on another machine with minimal change or not at all. The programs written in C++ are fast and efficient. C++ is
case sensitive.

1.3 GETTING STARTED WITH C++


The steps to understand C++ language are exactly similar to the steps that we have followed to understand
English language.
Communicating with a computer involves speaking the language the computer understands, which immediately
rules out English as the language of communication with computer. However, there is a close analogy between
learning English language and learning C++ language. The classical method of learning English is to first learn
the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are
combined to form sentences and sentences are combined to form paragraphs. Learning C++ is similar and easier.
Instead of straight-away learning how to write programs, we must first know what alphabets, numbers and special
symbols are used in C++, then how using them constants, variables and keywords are constructed, and finally
how are these combined to form an instruction. A group of instructions would be combined later on to form a
program.

1.4 STEPS IN LEARNING


 ENGLISH LANGUAGE:

Alphabets Sentences Paragraphs


Words

 C++ PROGRAMMING LANGUAGE


Alphabets
,Digits, Special Constants , Variables, Statements Program
symbols Keywords

1.5 THE FIRST C++ PROGRAM


Before we begin with our first C++ program, do remember the following rules that are applicable to all C++
programs:
3
(a) Each instruction in a C++ program is written as a separate statement. Therefore a complete C++ program
would comprise of a series of statements.
(b) The statements in a program must appear in the same order in which we wish them to be executed; unless of
course the logic of the problem demands a deliberate ‘jump’ or transfer of control to a statement, which is out of
sequence.

Blank spaces may be inserted between two words to improve the readability of the statement. (c)However, no
blank spaces are allowed within a variable, constant or keyword.
(d) All statements are entered in small case letters.
(e) C++ has no specific rules for the position at which a statement is to be written. That’s why it is often called a
free-form language.
(f) Every C++ statement must end with a ;. Thus ; acts as a statement terminator.

Example Program-1:
Program to print “Welcome”.

#include<iostream.h> Input/output stream header file


void main( ) The ‘main’ function
{ Your program begins here
cout<<“welcome”;

} Your program ends here

1.6 THE C++ CHARACTER SET (Alphabets of C++):


A character denotes any alphabet, digit or special symbol used to represent information. Shown below are the
valid alphabets, numbers and special symbols allowed in C++.

Alphabets A, B, ….., Y, Z
a, b, ……, y, z
Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Special symbols ~‘!@#%^&*()_-
+=|\{}
[]:;"'<>,.?/

1.7 OPERATORS:
The following tokens are the operators used in C++:

+ - * / % >
< >= <= = == !=
&& || += -= *= /=
%= ++ --

4
1.8 SPECIAL SYMBOLS:
The following are used as special symbols in our coding like ( ) { } [ ] < >.(Refer to C++ character set)

1.9 SIMPLE DATA TYPES


We know that variables can have different values depending on the user application in memory during execution
of a program. The type of the data that a variable can store in the memory can be defined using data type. The
basic data types that are supported by C++ language are classified as shown below:

 int
- Used to define integer numbers. The size of integer varies as
16-bit machine (2 bytes) and 32 bit machine (4 bytes).
 char
- Used to define single character or a sequence of characters called string. The size of char is
fixed as 16-bit machine / 32 bit machine (1 byte)
 float
- Used to define floating point or real numbers. The size of float varies as
16-bit machine (4 bytes) and 32 bit machine (8 bytes).

1.10 VARIABLES/IDENTIFIERS
In programming, a variable is a container (storage area) to hold data. To indicate the storage area, each
variable should be given a unique name (identifier). Variable names are just the symbolic representation of a
memory location. For example: int age=95;
Here age is a variable of integer type. The variable is assigned a value: 95.
The value of the variable can be changed, hence the name ‘variable’.

In C++ programming, you have to declare a variable before you can use it.
C++ Variables
In any language, the types of variables that it can support depend on the types of constants that it can
handle. This is because a particular type of variable can hold only the same type of constant. For example, an
integer variable can hold only an integer constant, a real variable can hold only a real constant and a character
variable can hold only a character constant.
The rules for constructing different types of constants are different. However, for constructing variable names of
all types the same set of rules apply. These rules are given below.
Rules for Constructing Variable Names
 A variable name can be a combination of alphabets, digits or underscores
 Maximum length of the variable name can be 31 characters (some compilers allow up to 247
characters)
 The variable names can be as short as a single character.
 The first character in the variable name must be an alphabet or an underscore (_).
 Variable name should not be a reserved word.
 No blank spaces are allowed within a variable name.
 No special symbol other than an underscore (as in gross_sal) can be used in a variable name.

Ex: Valid :si_int m_hra pop_e_89


Invalid: $F Sum,of, salary 9Section
5
Thus, if we want to calculate simple interest, it is always advisable to construct meaningful variable names like
prin, roi, noy to represent Principle, Rate of interest and Number of years rather than using the variables a, b, c.

1.11 DECLARATION OF VARIABLES


The compiler reserves the memory for the variables so that the data can be accessed, manipulated and stored in
these variables. For this to happen, all the variables should be declared in the beginning of the program. This way
is called type declaration. The purpose is to know the type of data to be stored and to reserve the required
amount of memory for the variables.
The syntax to declare a variable is shown below
datatype v1 ,v2 ....vn ;
where,
 datatype is any of the basic data type such as int ,char etc. except void.
 v1 ,v2 are the variables separated by commas and finally end with semicolon;

For example:
int p , n ,r ;
float si;
The variables p , n , r are integer variables and si is float variable.
Initialization of variables
An initial value may be specified in the definition of a variable.
Ex: int r =4; char x= ‘A’; float w =3.2;
Dynamic initialization
The expression after evaluating, initializes a variable is called dynamic initialization.
Ex: int a =8 , b = 9 ;
int c = a + b ;
The variable c is dynamically initialized to the sum of a and b (8+9 =17).

1.12 C++ TOKENS


A token is a smallest or basic unit of any program..They are classified as shown below

Keywords Ex: if,for,while etc


Variables/Identifiers Ex: sum,areaetc
Tokens Constants Ex: 10 ,10.5 ,’a’ , “DPS” etc
Operators Ex: + - * / etc (Refer to chapter on Operators)
Special symbols Ex: [ ] { } ( ) etc

1.12(1) C++ KEYWORDS


Keywords are the words whose meaning has already been explained to the C++ compiler. The keywords
cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword,
which is not allowed by the computer. The keywords are also called ‘Reserved words’. Some of the keywords
available in C++:

6
auto double inint ststruct
break else long switch
case e enum register tytypedef
char extern return union
c const float short unsigned
continue for signed void
default g goto sizeof volatile
do if static while

We have already learnt about variables, constants, operators and special symbols.
1.13 CONCEPT OF STREAMS IN C++
The iostream library provides input and output functionality using streams. A stream can basically be considered
as a source or destination of characters of varying length. Every C++ compiler provides a standard library to
support predefined input and output functions which we use in our program. To use those functions we need to
include some files at the beginning of each program with its extension .h. The most commonly used header file is:

o <iostream .h> - Defines Inpu/Output Functions

STREAM

Stream: A sequence of bytes. (data stream)

The #include directive gives directions to the compiler to place specified header files at the beginning of the
program during compilation.
Example: #include<iostream.h>

Other header files used in C++


 <conio.h> - console input output header file

Sample Program-2
Program to add the numbers 10 and 5

#include<iostream.h>
void main( )
{ Declaration of variables
int a, b, c ;
Initialization of variables
a = 10;
b= 5;
Dynamic Initialization
c = a + b;
Printing the output
cout << “sum=” << c;
1.14 STRUCTURE
} OF A C++PROGRAM

7
The general structure of a C++ program is shown below:

[Header Files declaration]


main( )
{
[variable /constant declaration section] Body of the function main()
[executable section]
}

Every C++ program has a primary (main) function that must be named main. The main function serves as the
starting point for program execution. It usually controls program execution by directing the calls to other
functions in the program. All statements that belong to main( ) are enclosed within a pair of braces { } as shown
below.
main( )
{
statement 1 ;
statement 2 ;
}

1.15 INSERTING COMMENTS


 A comment is a sequence of characters which improve the readability of a program. The symbols /* */
is used to insert comments in between the statements of the program.
Example:
/* Accept a number */
cin > > a;

 Comments cannot be nested.


Example:
/* Cal of SI /* Author sam date 01/01/2002 */ */ --- is invalid.
 A comment can be split over more than one line, as in,
/* This is
a jazzy
comment */
Such a comment is often called a multi-line comment.
 A comment with / / is called a single line comment. Whatever is written after double slash till the end of
the line is treated as a comment.
cout < < “We are in class VIII” ; // Comment can go here

 Compiler ignores the contents of a comment.

8
Example Program-3
#include <iostream.h>
/* Calculation of simple interest */
// Date: 25/05/2004
main( )
{
int p, n ; float r, si ;
p = 1000 ;
n=3;
r = 8.5 ;
/* formula for simple interest */
si = p * n * r / 100 ;
cout < < “simple Interest is: “ < < si;
}

1.16 COMPILATION AND EXECUTION


Once you have written the program you need to type it and instruct the machine to execute it. To type your C++
program you need another program called Editor. Once the program has been typed it needs to be converted to
machine language (0s and 1s) before the machine can execute it. To carry out this conversion we need another
program called Compiler. Compiler vendors provide an Integrated Development Environment (IDE) which
consists of an Editor as well as the Compiler.
The steps that you need to follow to compile and execute your first C++ program…

1. Select New from the File menu.

2. Type the program.

3. Save the program using F2 under a proper name (say Program1.cpp).

4. Use Ctrl + F9 /ALT + F9 to compile and execute the program.

5. Use Alt + F5 / ALT + R to view the output.


NOTE:
Press ALT + ENTER to maximize the window screen.

9
Parts of C++ Editor window

1.17 ROLE OF COMPILER


A C++ program is made by running a compiler which takes the typed source program and converts it into an
object file that the computer can execute. A compiler usually operates in two or more phases (and each phase may
have stages within it). These phases must be executed one after the other.

10
1.18 ESCAPE SEQUENCE CHARACTERS
It begins with backslash and is followed by one character.it give rise to special print effects.
Character Escape Meaning
character
Horizontal tab \t Cursor moves right by 8
positions
Newline character \n Move the cursor next line.

The backslash constants are also called character constants and are non-printable characters.

Example program 4
Program to print a character
#include<iostream.h>
main( )
{ Declaration of variables as characters.
char alphabet1,alphabet2,alphabet3; Command to clear the screen.
clrscr( );
alphabet1= ‘d’;
alphabet2= ‘p’;
alphabet3= ‘s’;
cout < < alphabet1 < < alphabet2< <alphabet3; Printing characters
}

Example program 5
Program using escape sequence characters
#include<iostream.h>
main( )
.
{
char ch1,ch2,ch3;
clrscr( );
ch1= ‘d’; Note this
ch2= ‘p’;
ch3= ‘s’; Use of newline character \n.
cout < < ch1 < < “\n” < < ch2 < < “\n” < < ch3; Use \t and \b instead of \n
}

1.19 INPUT AND OUTPUT STREAMS


Input operators help us to accept data from the input devices and store the data in the memory with the help of
variables. The output operators help us to display the data/result stored in the memory on to the output devices
using the variables.

11
 ostream: This is one of the output stream class. It adds put ( ) and write ( ) functions. It contains the
overloaded operator < <, called stream insertion operator, to write data from memory variables to
standard output devices (screen/monitor)
o The cout object: The cout (see-out) object sends to the standard output device, which is the screen.
Following is the format of the cout command:
cout < < data [ < < data]

The data can be variables, constants, expressions etc. The operator < < is used as output redirection
and called as put to operator.

 istream: This is one of the input stream class.It adds get ( ), getline( ) and read( ) functions. It contains the
overloaded operator > >, called stream extraction operator, to read data from a standard input device
(keyboard) and assign to memory variables.
o The cin object: The cin (see-in) object gets input from the keyboard. Following is the format of the
cin command:
cin > > variablename [ > > variablename >> ..]

Both the ‘istream’ and ‘ostream’ are included in the ‘iostream.h’ header file. Hence it is necessary to include
the header file at the beginning of the program.

Example program 6
Program to accept any 2 numbers and add them

#include<iostream.h>
main( )
{
int a, b, sum;
cout < <“Enter two numbers”;
cin > > a > > b;
sum = a + b;
cout < < “sum=” < < sum;
}

12
WORKSHEET 1.1

LESSON – 1: C++ CHARACTER SET, TOKENS, VARIABLES

I. 1) Do you agree that there is a close analogy between learning English language and learning C++
language?

ENGLISH LANGUAGE
Alphabets Words Sentences Paragraphs

C++ LANGUAGE

1) Write the character set of C++:


Alphabets

Digits

Special symbols

2) List the tokens in C++ with examples:

Tokens

II. Choose the best answer:


1. The function which is mandatory in all C++ programs.
a. start( ) b. system( ) c. main( ) d. program( )
2. What punctuation is used to signal the beginning and end of the main function in C++?
a. { } b. -> and -> c. BEGIN AND END d. ( and )
3. What punctuation is used to make the statement executable?
a. . b. : c. “ d. ;
4. Which of the following is a correct multi line comment?
a. */ Comments */ b. ** Comment ** c. /* Comment */ d. { Comment }
5. Which of the following is not a correct variable type?
a. float b. real c.int d. double
6. C++ language has been developed by
a. Ken Thompson b. Dennis Ritchie c. Dr. Bjarne Strousstrup d. Martin Richards
7. C++ programs are converted into machine language with the help of
a. An editor b. A compiler c. An operating system d. None of the above
13
8. Which of the following special symbol allowed in a variable name?
a) * (asterisk) b) | (pipeline)
c) - (hyphen) d) _ (underscore)
9. The single line comment in c++ is denoted by
a) ?? b) / / c) ** d) \ \
10. cout belongs to which library of c++?
a) iostream.h b) stdio.h c) stream.h d) stdoutput.h
11. A variable in c++
a) must have a valid datatype b) can't have a name same as keyword
c) must have a name starting with a character d) All of above
12. Which of the following is not a valid variable name declaration?
a) int _a3; b) int a_3; c) int 3_a; d) int _3a;
Explanation:
_______________________________________________________________________

III. Declare the variables and assign values.

No. Question Declaration


1 Declare an integer variable and assign a value 5

2 Declare a character variable and assign a value ‘z’

3 Declare a float variable and assign a


value 7.2

4 Declare 3 integer variables a, b and c. Value of c is


equal to sum of a & b.

5 Declare 2 float variables x and y.


Value of y is 2 more than x.

6 Declare 2 integer variables p and q. value of q is


same as p.

14
WORKSHEET 1.2

LESSON – 1 : INPUT/OUTPUT FUNCTIONS, BASIC PROGRAMMING

I. Fill in the blanks:


1. ______________is a function that defines the starting point of our program.
2. _____________datatype is used for decimal numbers.
3. _____________object is used to read integers, floating point numbers and characters in C++.
4. ____________ object is a function used to print any data on screen. Anything inside the double
quotes " " will be printed as it is on screen.
5. In the variable, char ch; how many characters can be accepted by ‘ch’?

II. Complete the C++ program to find area of a triangle given base and height :
#include <iostream.h>
main ( )
{
float base, height, area;
// Reads base and height of the triangle from user
cout < <______________________ ;
cin > >_____________________;
cout < <_________________________;
cin > >______________________;
// Calculates area of a triangle
area = (base * height) / 2;
cout < <_____________________________________________________;
return 0;
}

III. WRITE THE OUTPUT & EXPLANATION FOR THE FOLLOWING CODE
#include <iostream.h>
void main( )
{
int y = 10000;
y = 34;
count < < "Hello World!” < < y < <” \n";

}
Output: _______________________________________________________

Explanation: _________________________________________________________________

IV. Assignment:
1)
int c, a=8, b=10;
c=a+b;

What is the value of the variable c? How?


15
2) Write the shortcut keys to
a) Save
b) Compile
c) View the output of a C++ program.

V. Lab Activity:
Write C++ programs for the following:
1) To print the area of a rectangle by asking the user to enter the length and the breadth
( Given a = l * b)
2) To perform all arithmetic operations on any 2 numbers entered by the user.
3) To find the quotient and remainder of two numbers entered by the user.
4) To find the simple interest by asking the user to enter the principal, rate of interest and number of
years.(given si = p*r*t /100)
5) To convert km to m, feet and inches. The output must come one below the other. The command to
clear the screen must be used.
Given: m= km *1000;
Feet= km* 3280.84; inches= km * 39370.1;

16
CHAPTER 2:
OPERATORS AND EXPRESSIONS
2.1 Introduction:
An operator is a symbol that specifies the operation to be performed. For example + is to add , * is to multiply and
so on. The types of operators are as ,

 ARITHMETIC OPERATOR
Operation Symbol
Multiply *
Divide /
Find remainder %
Add +
Subtract -

 RELATIONAL OPERATOR
The relationship between 2 operands results in true or false.
Operation Symbol
Less than <
Greater than >
Greater or equal to >=
Lesser or equal to <=
Equal to ==
Not equal to !=

 LOGICAL OPERATOR

Operation Description Symbol


NOT The result is true if the operand is false and the result !
is false if the operand is true.
AND The result is true if both the operands are evaluated to &&
true.
OR The result is true if atleast one of the operands is ||
evaluated to true.

 ASSIGNMENT OPERATOR
It is used to copy the data or result of an expression into a memory location (which is identified by
a variable name) is called an assignment operator and is denoted by = sign. Ex a = 10
Also assigning a value or a set of values to different variables in one statement is called multiple
assignment statement.
Ex: i= j =k =20;

 SHORTHAND/ARITHMETIC ASSIGNMENT OPERATOR


It is used to simplify the coding of a certain type of assignment statement.

17
Short hand Short hand Meaning Explanation
operator statements
+= a +=2 a = a+ 2 Perform a+2 and store the
result in a
-= a-=2 a=a-2 Perform a-2 and store the
result in a
*= a*=2 a=a*2 Perform a*2 and store the
result in a
/= a/=2 a=a/2 Perform a/2 and store the
result in a

 INCREMENT /DECREMENT OPERATOR


The types are Post Increment operator ++ and pre increment operator ++, post decrement
operator -- and pre decrement operator --
Example int a =10
a++ (post increment) - result is 11 a-- (post decrement) –result is 9 ++a(pre increment) –
result is 11 --a (pre decrement) – result is 9

Example program 7 Example program 8


Program using post increment operator Program usingpre increment operator
#include<iostream.h> #include<iostream.h>
void main( ) void main( )
{ {
int i , j ; int i , j ;
i=2; i=2;
j=i++; j=++i;
cout < < “i=” < < i < < “ j=” < < j; cout < < “i= “ < < i < < “ j=” < < j;
} }
output output
i =3 and j=2 i =3 and j=3
First, j is assigned the value 2 and then the First, the value of ‘i’ is incremented to 3 and
value of ‘i’ is incremented to 3. then ‘j’ is assigned the increased value 3

2.2 Expression:
An expression is a combination of operands, operator and constants. In the expression a+b , a and b are operands
and + is the operator.The operands can hold integer ,floating values.
Based on the type of the operands in the expression,there are 3 modes of expressions namely,

Integer Expressions 4/ 2 = 2
4/3 = 1
3/4 = 0

Floating point expressions 4.0 /2.0 = 2.0


4.0/3.0 = 1.3333
3.0/4.0 = 0.75
Mixed mode expressions 4.0 /3 = 1.333

18
2.3 OPERATOR PRECEDENCE
It determines the order in which expressions are evaluated,so you can predict the output for the given
values.For ex,
Y= 6+4/2
Here, 4/2 is evaluated i.e 2 and it is added with 6.So the result is 8.In general , the precedence is as
follows.

Operator Associativity
() Left to Right
++ -- Right to left
* / % Left to Right
+ - Left to Right
<> <= >= Left to Right
== != Left to Right
&& Left to Right
|| Left to Right
= += -= *= /= %= Right to Left

Example: Determine the hierarchy of operations and evaluate the following expression:
i=2*3/4+4/4+8-2+5/8
Stepwise evaluation of this expression is shown below:
i=2*3/4+4/4+8-2+5/8
i=6/4+4/4+8-2+5/8 operation: *
i=1+4/4+8-2+5/8 operation: /
i = 1 + 1+ 8 - 2 + 5 / 8 operation: /
i=1+1+8-2+0 operation: /
i=2+8-2+0 operation: +
i = 10 - 2 + 0 operation: +
i=8+0 operation : -
i=8 operation: +

Note that 6 / 4 gives 1 and not 1.5. This so happens This so happens because 6 and 4 both are integers and
therefore would evaluate to only an integer constant. Similarly 5 / 8 evaluates to zero, since 5 and 8 are integer
constants and hence must return an integer value.

19
WORKSHEET 2.1
LESSON – 2: OPERATORS

I. Multiple choice questions:

1. Which operator has the highest priority?


a) ( ) b) [ ] c) * d) /
2. What is correct order of precedence in C++?
a) Addition, Division, Modulus b) Addition, Modulus, Division
c) Multiplication, Subtraction, Modulus d) Modulus, Multiplication, Subtraction
3. The precedence of arithmetic operators is (from highest to lowest)
a) %, *, /, +, –
b) %, +, /, *, –
c) +, -, %, *, /
d) %, +, -, *, /

. 4. Hierarchy decides which operator


a) is most important (b) is used first (c) is fastest (d) operates on largest numbers
II. Evaluate the following expression and show their precedence

Expression Solution

1.float j;
j=5.0/2.0 *4

2. int k
k= 5*8/4 +2

3. int p
p=6+3*2/2

4.float k;
k = 3.0 / 2.0 * 4 + 3.0 / 8.0 +3

5.int p ;
p = 10 / 2 * 3 + 3 /4 – 8 / 5

20
III. WRITE THE OUTPUT & EXPLANATION FOR THE FOLLOWING CODE

1)
#include <iostream.h>
Output: ________________ void main( )
{
Explanation: int i = -3;
int k = i % 2;
cout << k;
}

2) #include < iostream .h>


void main( )
Output: __________
{
Explanation: int i = 5;
i = i / 3;
cout << i;

3) What is the value of x in this C++code?


#include < iostream .h>
Output: __________ void main( )
{
Explanation: int x = 5 * 9 / 3 + 9;
cout << x;
}

4) #include < iostream .h>


void main( )
Output: ______________ {
int y = 3;
Explanation:
int x = 5 % 2 * 3 / 2;
cout <<"Value of x is: ” << x;
}

21
WORKSHEET 2.2
LESSON – 2: INCREMENT & DECREMENT OPERATORS

I. Write the Output for the following codes and Explanation:


1) Output: ___________ #include<iostream.h>
void main( )
Explanation:
{
int i=3;
i = i++;
cout <<"\n" << i;
}

2) Output: ___________
#include <iostream.h>
Explanation: void main( )
{
int i=2;
int j =++i+ i;
cout <<"\n" << j;
}

#include<iostream.h>
void main( )
3) Output: ___________ {
int x=4, y, z;
Explanation: y = --x;
z = x--;
cout << x <<"\n" << y << “\n” << z;
}

4) Output: ___________ #include<iostream.h>


void main( )
Explanatio
{
int i=2, j=6;
22j=j-i++;
cout <<"\n" < < ++i < < j;
}
5) Output: ___________
#include <iostream.h>
Explanation: void main( )
{ int a = 1, b = 1, c;
c = a++ + b;
cout << a;
cout << b;
}

II. Assignment:
What is the value for the following expressions.
Note: The statements are not related to each other.

int a =10;
1. cout < < a++;

2. cout < < a--;

3. cout < < a*=2;

4. cout < < a/=2;

23
CHAPTER 3:
DECISION CONTROL STRUCTURE

3.1 INTRODUCTION:
A statement is the smallest element of a programming language. It is used to inform the computer to perform an
action when a program is executed. The types are
a) Simple statement
i =0; /* statement 1 */
sum = 5 ; /* statement 2 */
b) Compound statement
The set of statements enclosed within a pair of braces as { and }.
{
base = 3.0 ;
height = 5 ;
}
c) Control statements
The order in which the statements are executed is called control flow. The statements that are used
to control the flow of execution of the program are called control statements. They are classified as
 Branching statements
 Conditional branch statements
-Simple if , if-else , nested if ,switch
 Unconditional branch statements
- Goto , break , continue
 Looping statements
For loop,do while
3.2 BRANCHING STATEMENTS
The statements that alter the sequence of execution of the program are called branching statements.
Normally all the statements are executed one after the other. The computer can skip the execution of some
statements based on some condition are called conditional statements.
For example: if , switch

If the user wants to transfer the control from one point to another point during execution without any condition are
called unconditional control statements.
For example: goto , break etc

3.2.1 Simple IF Statement


When a set of statements have to be executed or skipped when the condition is true or false, then if
statement is used.The syntax is shown below:
if (condition)
{
St – 1 ; statements executed when given condition is true
St-2;
}
24
Example:
if (a%2 == 0 )
{
a++;
cout < < a ;
}
Note: If there is one statement no need use { }
For example:
if a > b
cout < < “ a is greater than b”;

3.2.2 The IF-ELSE statement

It is a two–way statement which executes the different set of statements based on the given condition. The syntax
is

if (condition)
{
St-1; When given condition is true
St-2;
}
else
{
St fa1; When given condition is false
St fa1;
}

Example program 10
Program to print whether a person is eligible to vote or not
#include<iostream.h>
void main( )
{
int age;
cout << “Enter your age\n”;
cin >> age;
if (age>=18)
cout << “You are eligible to vote”;
else
cout <<“You are not eligible to vote”;
}

25
Type – II (if - else if)
if (cond1)
{ When cond1 is true
St -1; }
else if (cond2)
{
st-2; When cond1 is false and cond2 is true
}

else if (cond3)
{ When cond1 and cond2 are false and cond3 is true
st-3;
}

For ex:

Example program 11
Program to print the remarks by checking the marks
#include<iostream.h>
void main( )
{
float a;
cout << “Enter your marks”;
cin >> a;
if (a >=80 && a <=100)
cout << “Distinction”;
else if (a >=65&& a< 80)
cout <<“First Class”;
else
cout <<“Second Class”;

3.2.3 The NESTED IF statements


An if or if-else statement within another if or if-else statement is called nested if statement. When an
action has to be performed based on many decisions,then this statement is used. So, it is called muti-way decision
statement. The syntax are,

26
Type -I
if(cond 1)
{
if (cond2 )
{
Part -A When cond2 is true
} When cond1 is true
else
{
Part -B When cond2 is false
}
else
{
Part -C When cond1 is false
}
}

Example program 11
Program to find the greatest of the three numbers using Nested if
#include<iostream.h>
main ( )
{
int n1, n2, n3;
cout << “Enter three numbers: ”;
cin >> n1 >> n2 >> n3;
if (n1>= n2)
{
if(n1 >= n3)
cout << n1 << “ is the largest number”;
else
cout << n3 << “ is the largest number”;
}
else
{
if (n2>=n3)
cout << n2 << “ is the largest number”;
else
cout << n3 <<“ is the largest number”;
}
return 0;
}
3.3 The switch statement

It provides a way to select an alternative out of several alternatives based on the choice. The choice can be
any integer value or a character .The choice can also be an expression which results in an integer value. Based on
this , the control is transferred to a particular case value.

27
The syntax is
switch (choice/expression)
{
case value -1:
Block -1;
Break;
case value -2:
Block -2;
Break;
...
default:
Block -1;
}

Example Program 12
Program to print the menu card of an ice cream parlor and to print the price of the chosen flavor
#include<iostream.h>
void main( )
{
int choice;
cout << “Menu card\n”;
cout << “1.chocolate \n2. Vanilla \n3. Mango \n”);
cout << “Enter your choice as 1, 2 or 3”;
cin >> choice;
switch(choice)
{
case 1:
cout << “price of chocolate flavor – Rs.80”;
break;
case 2:
cout << “Vanilla – Rs.40”;
break;
case 3:
cout << “Mango flavor – Rs.60”;
break;
default:
cout <<“Invalid entry”;
}}

28
The following are valid and invalid ways of writing switch expression and case constants:

User input Valid/Invalid Reasons for invalidity


switch(i) Valid
switch(i * 10 ) Valid
switch(i + 5. 5) Invalid Float is not allowed
Case 4: Invalid Keyword case should be
lower case letters
case “+” Invalid Strings not allowed
case ‘choice’ Invalid Only one character is
allowed
case ‘h’ Valid
3.3.1 Switch case Facts
1. The expression used in switch must only be integral type (int, char and enum)
2. A float expression cannot be tested using a switch
3. Cases can never have variable expressions (for example it is wrong to say case a +3 : )
4. Multiple cases cannot use same values/constants.
5. Cases cannot have string values.
6. All the statements following a matching case execute until a break statement is reached.
7. The default block can be placed anywhere in the switch block.
8. The statements written above cases are never executed.

29
WORKSHEET 3.1
LESSON – 3: IF, IF-ELSE, NESTED IF

The if, if...else and nested if...else statement are used to make one-time decisions in C++
Programming, that is, to execute some code/s and ignore some code/s depending upon
the test expression.

I. Write the output for the following codes:


1) Output: ___________ #include <iostream.h>
int main ( )
Explanation:
{
int x = 5;
if (x < 1)
cout <<"hello";
if (x == 5)
cout <<"hi";
else
cout <<"no";
return 0;
}
2) Write the output for the following code:
#include <iostream.h>
main( )
{
int m=40,n=20;
if (m>n)
{
cout <<"m is greater than n";
}
else if(m<n)
{
cout <<"m is less than n";
}
else
{
cout <<"m is equal to n");
}
return 0; }

30
3) Observe the code and answer the questions:

.....
if(num>10)
cout << “num is greater than 10”;
else
cout << “num is less than or equal to 10”;
.....
a) What is the output if num=5______________________________________
b) What is the output if num=100 ____________________________________

4) Observe the code and answer the questions:


.....
int var1, var2;
cout <<“Input the value of var1:”;
cin >> var1;
cout << “Input the value of var2:”;
cin >> var2;
if(var1 !=var2)
{
cout <<“var1 is not equal to var2”;
if(var1 > var2)
{
cout <<“var1 is greater than var2”;
}
else
{
cout << “var2 is greater than var1”;
}
}
else
{
cout <<“var1 is equal to var2”;
}
......
a) var1=5 var2=5 Output:_________________________________________________
b) var1=15 var2=20 Output:_____________________________________________
c) var1=20 var2=12 Output:_______________________________________________

31
5) ASSIGNMENT
Write the syntax difference between IF-ELSE IF and IF-ELSE.

II. Lab Activity:

a. Any year is input through the keyboard. Write a program to determine whether the year is a leap
year or not.

b. Any integer is input through the keyboard. Write a program to find out whether it is an odd number
or even number.

c. A program to display the grade obtained by a student based on the marks. The relation between the
grades and marks is shown below:
Marks Grades
91 to 100 A
81 to 90 B
71 to 80 C
61 to 70 D
51 to 60 E
Else F

d. Any character is input through the keyboard. Write a program to check if the entered character is
uppercase or lowercase.

e. A program to display the gender is male or female.

f. Any age is input through the keyboard. Write a program to determine if eligible to vote or not.

g. Any 2 numbers are input through the keyboard. Write a program to compare the two numbers.

32
WORKSHEET 3.2

LESSON – 3: SWITCH CASE

1. If a programmer has to choose one block of statement among many alternatives, nested if...else can be used
but, this makes programming logic complex.
What is the simple and better way to do so? Also give syntax.
2. In a switch statement, what will happen if a break statement is omitted?
3. When is a “switch” statement preferable over an “if” statement? And what are its limitations
4. Rewrite the given code snippet using switch-case-break statement...

#include <iostream.h>
void main( )
{
char code = 'd';
cout <<"Enter your transaction code, d - deposit, w - withdrawal: \n";
cin >>code;
float balance = 0.0, amount = 0.0;
if(code == 'd')
{
cout << "Your deposit...\n";
balance = balance + amount;
}
else if(code == 'w')
{
cout << "Your withdrawal...\n";
balance = balance - amount;
}
else
cout << code << "code not allowed\n"; return 0;
}

5. Keywords of switch statement and their use:

SWITCH

CASE

BREAK

DEFAULT

33
LAB ACTIVITY:
1. Write a program that asks user input for an arithmetic operator ('+','-','*' or '/') and two operands and
perform the corresponding calculation on the operands.
2. Enter a Character and check whether it is Vowel or a Consonant. Use Switch case.
3. Using switch case, write a program to print the gender as male or female.
4. Write a program to check if the number entered is even or odd using switch case.
5. Write a program to check if the year is a leap year or not using switch case.
6. Write a program to read week day number and print weekday name. Use switch case.
7. Write a program to print number of days in month, given the month number as input.
8. Write a program to compare two numbers.

Assignments
1. Identify the errors and provide reasons, also write the corrected statements:

Corrected statements Reason


1 float k;
switch (k)
2 int j;
switch ( j)
{
j=j+1;
case 1: cout << “find me”;
break;
case2: cout << “ found you”;
break;
case j+3: cout << “catch” ;
break;
}
3 int p;
switch (p)
{
Case 1: cout << “check1”;
break;
case 1.2: cout << “check2” ;
break;
case “p”: cout << “check3”;
break;
}
4 char ch;
switch (ch)
{
case ‘a’: cout << “pick 1”;

case ‘bk’: cout << “pick2”;


break;
case ‘p’; cout << “pick 3”;
break;
}
34
5 int m=3;
switch (m+3)
{
case 6: cout << “ good” ;
break;
case 7: cout << “ better”;
case 8: cout << “best”;
default: cout << “classy”;
}
6 int pot;
switch (pot)
{
default: cout << “colourful”;
break;
case 1: cout << “cracked”;
break;
case 2: cout << “broken”;
break;
case 1: cout << “ check” ;
break;
case : ‘0’ cout << “fix it” ;
break;
}

35
CHAPTER 4:
THE LOOP CONTROL STRUCTURE
4.1 INTRODUCTION
The statements that enable the programmer to execute a set of statements repeatedly until a certain condition is
reached are called Looping statements. The various types of looping statements are as,
 for statement
 while statement
 do-while statement

4.2 The for statement


The set of statements to be executed repeatedly for a fixed number of times till the condition is reached.If we
know well in advance as how many times a set of statements have to be executed, the for loop is the best choice
The syntax is,
for (exp1 ; exp2 ; exp3)
{
St-1; Body of the loop
St-2;
}
where,
 for is a reserve word
 exp1 – initialization expression.
 exp2 – terminal condition.
 exp 3 – step size(May be increment / decrement)
 body of the loop – consists of various statements.

Example program 9
Program to print the numbers from 1 to 5
#include<iostream.h>
void main( )
{
int i;

for ( i =1 ; i<=5 ; i++)


{
cout < < i < < ‘ ‘;
}
}

Now, let us see what will happen when the above for-loop is executed.
o When the for loop is executed for the first time, initial value of i=1
o The condition is i<=5 is checked and is true since i=1
o So, control enters into body of the loop and displays 1 on the screen using printf statement.
o Then i is incremented by 1 and the condition i<=5 is verified again.The loop is repeatedly executed
for i= 1,2,3,4 and 5 and all these are displayed one after the other.
o Finally, when i is 6,the condition i<=5 fails and control comes out of the loop and the message
“Out of the loop” is displayed on the screen.
The following statement shows a logical error since the loop statement ends with a ;
for (i=1 ; i<=n ; i++) ; { }

36
Worksheet-4.1
Chapter 4-The Loop Control Structure

The statements that enable the programmer to execute a set of statements repeatedly until a certain condition is
reached are called Looping statements

1. Analyze the given code

for ( j=10; j<=20 ; j++)


{
cout< < j ;
}
cout < < “Out of the loop”;

Based on the above code which of the following statements are Invalid and why?

a. When the for loop is executed for the first time,initial value of j=5
b. The condition is j<=20 is checked and is false since j=5.
c. Control enters into body of the loop and displays 15 on the screen using printf statement.
d. J is incremented by 1 and the condition j<=20 is verified again.
In which case will the control come out of the loop, and what output will b expected.

2. Give the syntax for the FOR loop. And explain each argument of For loop.

3. Give the output for the following


a.
#include <iostream.h>
void main ( )
{ int a;
/* for loop execution */

for (a = 10; a < 20; a = a + 1 )
{
cout < < “value of a: “ < < a < < “\n”;
}
}

b. #include < iostream.h>


void main( )
{
int n, count, sum=0;
cout < <"Enter the value of n.\n";
cin > > n;
for (count=1;count<=n; count++) //for loop terminates if count>n {
sum= sum+count; }
cout < < ”Sum=" << sum;}

37
c. int i;
for (i=1; i<=3; i++)
{
cout < <"hello, World";
}

4. Debug the code given and write only the corrected statements.

No. Program Only Correct statements

1 #include <iostream.h>
void main( )
{ int i;
For (i=1: i<=10; i++)
cout << “Number: “ << i;
}
2 #include <iostream.h>
void main( )
{ int p;
for (p= =20; p>10; p-)
cout << “Number: “ << p;
}
3 #include <iostream.h>
void main( )
{ int k;
for (k=100; k=<110; k++) ;
cout << “Number: “ << k;
}

LAB ACTIVITY:

1. Write a program using for loop to print the numbers from 10 to 20.
2. Write a program to print the numbers from 50 to 40 in reverse order.
3. Write a program to find the sum of first 10 natural numbers.
4. Write a program to print the first 10 odd numbers.
5. Write a program to print the multiplication table.

38
REVISION WORKSHEET 1
Topics: Lesson 1 to 3
I. Questions:
1) Define the C++ character set.
2) Give any 3 examples of keyword
3) 10 is stored in a memory location and a name a is given to it. Then a new value 20 is stored to the same
memory location. What happens now? Why?

4) Give one example for


i) an integer constant
ii) a real constant
iii) a character constant

5) int a, b=10,c=20;
a=b*c;
Explain the initializing of the variable a here.
6) Write the names of header files used in C.
7) What is incorrect in the following statement : x*y= z
8) cout <<“I study in DPS”
What type of error do we get?
9) a=b=c=100
Explain this concept.
10) a*=2 Implies _____________
11) Identify the type of constant and correct them if they are invalid:
a. 1. 42,000 b. 2.5E3.6 c. ‘DPS’

III. Point out the errors:


1. Cout << a;
2. char s;
cin << S;
3. cout << “Welcome”

IV. Write C++statements to declare and accept values for the following:
1. Accept your age.
2. Enter your gender.
3. Accept temperature in your city.

39
V. Write the output for the following code:
a)
#include <iostream.h>
int main( )
{
float k =10 ;
cout <<“Value of k is: “ << k;
return 0;
}

#include <iostream.h>
int main( )
{
float a = 5 , b =2 ;
int c;
c = a % b;
cout << c;
}
b)
#include <iostream.h>
main ( )
{ int i =2 , j= 3 , k ,l;
float a, b;
k = i / j * j;
a = j /i * i;
cout << “k = “ << k<< “\n”;
cout << “a= “ << a << “\n” ;
}

VI. Write C++Programs for the following:


1) To print a message about your friend.
2) To find the product of 5 numbers.

40
DELHI PUBLIC SCHOOL, BANGALORE SOUTH
Pre-Midterm Assessment
Subject: Computers

Total Marks: 20

I. Answer the following: (5 x 1=5)


1. Give the file extension of a C++ program.
2. Give the data type used to store decimal number values.
3. Define the term Token._

4. What is the full form of conio in ‘#include<conio.h>’?


5. Define the term Algorithm.

II. Give a single C++ statement for the following: (3 x 1=3)


1. To declare a character variable, Char and assign a value ‘A’.
2. To declare and assign a decimal value into the variable, Decimal.
3. To declare a variable, Quo and store the quotient of a and b, where a=10, b=3.

III. Identify and debug the following C++ statements: (2 x 1=2)


1. Float 12_=3.4;
2. Cout>>”Hello World”; _

IV. Identify the valid variables. If not valid, give reason. (3 x 1=3)
1. Delhi%Public*School
2. Bangalore 560050
3. 123Start

V. Classify the following into each type of tokens. (2 x 1=2)


1. Char
2. include

41
VI. Do as directed.
1. Write an algorithm to display multiples of 7. (3 x 1=3)

2. Write a note on Comments in C++ Programming Language. (2 x 1=2)

42
DELHI PUBLIC SCHOOL, BANGALORE SOUTH
Midterm Assessment
Subject: Computers
Class: VIII Sec: Total Marks: 20

I. Solve the following expressions.


1. int i = 8+4*5-3%4+6/2; (1 x 3=3)
cout<< “Value of i is \t”<< i;
Working: Output:

2. int j = 5/3+4*6-4; (1 x 2=2)


cout<< “Value of j is \t”<< j;
Working: Output:

II. Answer the following questions with reference to the given list of operators. (4 x 1=4)
+ < && % == / ++

1. Identify and name the Relational and Logical operators.

2. Identify and name the operator that requires single operand.

43
3. Name the operator that has least priority.

4. Identify and name the operator that operates upon true or false as input values.

III. Complete the following code snippet. (3 x 1=3)


#include<iostream.
h> void main()
{
float a) , height, volume;
//Code to accept radius and height of cylinder
cout<< “Enter the height and radius of the
cylinder”; cin>>radius>> b) ;
//Code to calculate volume of
cylinder volume =
3.14*radius*radius*height;
cout<< “Volume of Cylinder is”<< c) ;
}

IV. Give the output of the following code snippet. (3 x 1=3)


#include<iostream.h>
void main()
{
int a=5, b=2, c;
c = a++ / b-- + a++;
cout<< “Value of a = \t”<<a;
cout<< “\nValue of b = \t”<<b;
cout<< “\nValue of c = \t”<<c;
}

Working: Output:

44
V. Do as directed.
a. Write a program to calculate the Lateral Surface Are of a cuboid by accepting values
for required variables. Display all the input and output values on different lines.
Lateral Surface Area = 2h(l+b) (3 x 1 = 3)

b. Give any two differences between = and ==. (2 x 1=2)

45
DELHI PUBLIC SCHOOL, BANGALORE SOUTH
ANNUAL EXAMINATION
Subject: Computers

Class: VIII Sec:

Total Marks: 20

I. Give the output of the following code snippet and also mention the number of times the loop executes.
1. int i=3, j; (2 x 1=2)
for(i=6;i<=2;i--)
{ j=i--;
cout<<“Value of j:”<<j<<“\n”;}
Working: Output:

2. int n=3, i, pro=1; (2 x 1=2)


for(temp=2; temp<=n; temp++)
{ pro= pro*temp; }
cout<<“Product=”<<pro;
Working: Output:

II. Solve and give the output for the following expressions.
1. int i=4, j=2, k; (2 x 1=2)
k=i++ / j + j--;
cout<< “i=”<<i<< “\tj=”<<j<< “\tk=”<<k;
Working: Output:

46
2. int a=2,b=3,c; (2 x 1=2)
c=a*b-a/b;
cout<< “Value of c is=\t”<<c;

Working: Output:

III. Identify and debug the errors in the following code snippet and rewrite the correct code. Assume
header files and main is present.
1. int m; (3 x 1 = 3)
For(m=2:m<=4:m++)
cout<<„DPS‟;

2. int a=2, b=4 (2 x 1 = 2)


if cout<< “HI”;
Else(a<b) cout<< “HELLO”;

IV. Do as directed

1. Define the term variable. Give any two rules to name a variable. (2 x 1 = 2)

47
2. Explain the different types of initialization of variables in C++ with examples. (2 x 1=2)

3. Give a single C++ statement for the following: (3 x 1=3)


a. To declare a character variable and store the city name Bangalore as B.
b. To declare an appropriate variable and store the value 100.9 _______________
c. To declare the variable c and assign the quotient of two integer variables a and b._________________________

48
REVISION WORKSHEET
Lesson 4
1) Define Switch Case statement.
2) What are the limitations of switch case
3) What is the use of break in Switch case
4) Write the syntax difference between Simple IF and IF-ELSE.
5) Give the syntax of IF-else
6) Give syntax of nested if-else
7) What is the use of Default in Switch case
8) What is the value for the following expression if.
h =5;
a. cout << h++;
b. cout << h--;
c. cout << h% =2;
d. cout << h - =2;

9) Which of the following cannot be checked in a switch-case statement?

A. Character B. Integer

C. Float D. enum

10) GIVE THE OUTPUT FOR THE FOLLOWING:

a.
#include <iostream.h>
void main()
{
int x = 5;
if (x < 1)
cout <<"hello";
if (x == 5)
cout <<"hi";
else
cout <<"no";
}

49
#include <iostream.h>
b.
int main () {

/* local variable definition */


char grade = 'B';

switch(grade) {
case 'A' :
cout <<"Excellent!\n";
break;
case 'B' :
case 'C' :
cout << "Well done\n" ;
break;
case 'D' :
cout <<"You passed\n";
break;
case 'F' :
cout << "Better try again\n" ;
break;
default :
cout <<"Invalid grade\n" ;
}

cout <<"Your grade is: “ << grade ;

return 0;
}

50
LAB ACTIVITY:

a. To find whether a number is prime or not


b. To find whether a number is odd or even.
Rewrite the above programs using Switch Statement.

Answer the following:

1. Determine the value of total after each of the following loops is executed.

2. Give the use of the following in C++ programming:


a. Looping statements
b. Break Statement
c. Continue statement

3. Give the syntax of FOR LOOP and explain what each element mean.

4. Determine the value of total after each of the following loops is executed.
a. Total=0;
for(i=1;i<=10;i++)
Total=total+1;
b. Total=50;
for(i=1;i<=10;i++)
Total=total-i;
c. Total=1.0;
for(i=1;i<=5 ; i++)
Total=total/2.0;

5. What is the disadvantage of using GOTO statement in C++ programming?

51
CHAPTER-1
EXCITE
Introduction to Artificial Intelligence or AI

Artificial intelligence (AI) is the general study of making intelligent


machines. Machines can mimic learning and problem solving skills of
human beings through AI.
John McCarthy, a professor at Stanford University came up with the
name "artificial intelligence" in 1956 and coined the word ‘artificial
intelligence’ at a conference held at Dartmouth college.

DEFINITION: Artificial intelligence is the ability of the machines or


computer programs to carry out tasks that require human beings to
use their intelligence.
Artificial intelligence should have some of the following behaviors that are associated with
human intelligence:

1. Planning 6. Knowledge representation


2. Learning 7. Manipulation
3. Reasoning 8. Creativity

4. Problem Solving 9. Social Intelligence


5. Perception
6. Motion

Nearly everywhere we look today, we see intelligent systems like -

 Siri on your iPhone/iPad talking to us.


 Fitbit to understand if you are walking, running, sleeping,
 Google search uses NLP to understand all articles in web and generate answers to
questions. For e.g.: If we ask who is captain of Indian Cricket team it uses data it learnt
through NLP from many users, online articles and gives the most popular answer.
 Google Maps showing real time traffic congestion and accordingly it shows ETA
(expected time of arrival) almost accurately.
 When we upload a photo to Facebook, it automatically recognizes the face of the person
in the photo and provides the tag for the person.

52
 Google lens in scanning the items in real world.
 Google search allows web search through voice.
 While typing in a document/excel, Microsoft automatically suggests word & grammar
corrections and suggestions.
 Alexa taking our voice commands & reciprocating accordingly.
 Shopping sites like Amazon, Flipkart offering recommendations by understanding your
previous choices.
 Self-driving cars.

Types of Artificial Intelligence

Weak AI: Current AIs are weak Artificial Intelligence programs, i.e., these programs act
intelligently but are not intelligent. For example, advanced chess programs, personal assistants,
translator’s etc. The responses given by these systems are a part of their programming.
Strong AI: Strong AI systems, on the other hand, will not be limited to programmed responses.
They will use clustering and association for processing data. Such systems will not act
intelligent but will be intelligent. They will act more like the human brain.

Artificial Intelligence vs Human Intelligence

Human Intelligence Artificial Intelligence

Human decision making is based on Artificial Intelligence uses models for


cognition. making decision.

Intelligence is natural Intelligence is artificial in nature

Decision making can be biased. Decision making can be free from biased.

It is general purpose intelligence, i.e., Performs tasks only for which they are
capable of performing different tasks. developed.

53
FIELDS RELATED TO ARTIFICIAL INTELLIGENCE

Machine Learning: Machine learning systems are those which improve their performances with
more experience or information. This is sometimes regarded as sub-field of AI and at other
times a separate sub-field of Computer Science.

Deep Learning: Deep Learning or Deep Neural learning are systems that are capable of learning
from unstructured or unlabeled data. For example all family photographs in your house. Emoji
Scavenger game is based on deep learning neural networks.

Data Science: It is the term that is used for referring to different related sub-disciplines. These
sub-disciplines include machine learning, statistics, data storage, web development, etc.

Robotics: The field of robotics deals with construction and programming of robots. Robots are
computing machines that have both hardware and software. The artificial intelligence is used
for the software or programming part of the computer.

Different areas of AI used in the field of robotics are:


 Computer vision and natural language processing.
 Neural networks for understanding human emotions.
 Machine learning and deep learning for making robots
adaptive to nearby surroundings.

Applications of AI:
1. Games: Game developers are using Al technology to
improve the strategic aspects of games. These games
learn and adapt themselves, providing better gaming
experience.
2. Natural Language Processing: This helps computer-based
system to understand the natural language that human
beings use. The game Mystery Animal is based on this
technology.
3. Expert Systems: These systems are used to provide advice,
explanations, solutions, etc. to the users. These are based
on the integration of a number of different programs and
sources.

54
4. Vision Systems: These systems use Al technology to understand the images. These include
identification of faces, diagnosing of patients, identifying damages to buildings and fields, etc.

5. Handwriting Recognition: It is related to the technology used in vision systems. In these


systems, the computer converts text on the paper, or inputs given by the users from stylus
into the computer readable format.

6. Intelligent Robots: Artificial Intelligence is widely being used to improve the working of the
robots so that they are better able to perform the tasks assigned by human beings.
Disadvantages of AI
1. High Cost:
Creation of artificial intelligence requires huge costs as they are very complex machines. Their
repair and maintenance require huge costs. It needs constant updates with new data points to
keep learning else, system will become obsolete with old data and might actually give wrong
answers or decisions.
2. Can’t Replicate Humans level of decision yet?
Machines do not have any emotions and moral values. They perform what is programmed
and cannot make the judgment of right or wrong. Even cannot take decisions if they encounter
a situation unfamiliar to them. They either perform incorrectly or breakdown in such situations.
3. No Improvement with Experience:
Unlike humans, artificial intelligence cannot be improved with experience. With time, it can
lead to wear and tear. It stores a lot of data but the way it can be accessed and used is very
different from human intelligence.
AI cannot improve with one data or experience, like humans cannot learn from one mistake or
correctness. Need lot of data points to understand and find a pattern.
4. No Original Creativity:
5. Unemployment:
Replacement of humans with machines can lead to large-scale unemployment. Many low end
jobs like factory worker, drivers can become obsolete.
6. Wrong decisions
AI can be trained by people with wrong intent to do harm to people or influence people to take
wrong decisions.
7. Wrong conclusion with inadequate data
Since AI data and Algorithms are given by humans, they can give data or they will act
accordingly to the data given by us to them. This might lead to wrong conclusion.

55
8. Ethical values
AI can be trained to do ethical and moral things as well as unethical things. E.g cameras installed
in all shops and public places can track where we are going every day and understand without
our knowledge which is immoral.

THREE DOMAINS OF ARTIFICIAL INTELLIGENCE


Data: It refers to the data that is right for the AI systems.
Types of Data:
 Sound Data for voice recognition systems
 Text Data for automatic classifying systems, and
 Image and video data for computer vision systems.
Computer Vision (CV): It is s technology used for making machines see and perceive the human
world as human beings do. This requires images or visual data.
Uses of Computer Vision Technology include:
 Face recognition
 Image Retrieval
 Gaming and control
 Surveillance
 Smart cars
Natural Language Processing (NLP): It works on enabling the computers to understand
naturally written or spoken languages, like English, Hindi. This will make computers capable of
natural communication.

Resources:

Link for Game 1 (Rock, Paper and Scissors):


Path for game - http://bit.ly/iai4yrps
Link for Game 2 (Mystery Animal):
Path for game - http://bit.ly/iai4yma
Link for Game 3 (Emoji Scavenger Hunt):
Path for game - http://bit.ly/ai4yesh

Link for Game 4 (Quick Draw):


Path for Game: https://quickdraw.withgoogle.com/

56
Worksheet 1.1

I. Which of the following are AI and which are not? State Yes, No or Maybe

1. An Excel spread sheet that determines batting averages and other predefined parameters on
a given data set. ________________
2. Google Maps, navigation system, for finding the fastest route from home to your school.
_________
3. Application such as CorelDraw that allow you to edit the brightness, colour, and contrast in a
picture. ___________________
4. An online books recommendation platform such as Flipkart that suggests books based on the
buyer’s reading and buying behavior. ___________________
5. Huge data storage solutions like YouTube that can store videos and stream them to many
users at the same time. _____________

II. MULTIPLE CHOICE QUESTIONS (MCQs)


1. Which of the following statements is true?
a. Artificial Intelligent Systems involve software only.
b. Artificial Intelligent Systems involve hardware only.
c. Artificial Intelligent Systems involve software and hardware.
d. Artificial Intelligent Systems involve neither software nor hardware.
2. Which of the following types of tasks are comparatively easy for artificial intelligent systems?
(i) Common tasks (ii) Expert tasks
a. (i) are easier. b. (ii) are easier.
c. Both (i) and (ii) are equally easy. d. Both (i) and (ii) are equally difficult.
3. With the help of ___________ computers understand the common language used by human
beings.
a. Neural Language Processing. c. Common Language Processing.
b. Natural Language Processing d. Human Language Processing.
4. Which of the following types of data can be used by artificial intelligent systems?

57
a. Sound data b. Text data c. Image data d. All of these.
5. Which of the following technology is used by games like Emoji Scvanger Hunt?
a. Natural Language Processing
b. Natural Image Processing.
c. Computer vision
d. Neural Data Images.
6. Which of the following is not one of the three domains of artificial intelligence?
a. Data b. Natural Language Processing
b. Neural Networks c. Computer vision
7. What was the name of the computer that defeated World Champion Gary Kasparov in 1997?
a. Deep Sea b. Ocean Blue c. Old sea d. Deep Blue

III. Answer in brief:

1. What is Artificial Intelligence?


_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
2. List the Programming Languages used in AI?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
3. What are the Applications of AI?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
4. Name the three domains of AI and the games related to it
______________________________________________________________________________
______________________________________________________________________________

58
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

5. What is Computer Vision domain in AI? Write two uses:

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

IV. Guess the following games and its domains.


1. ____________________________________________

____________________________________________

____________________________________________

2. ____________________________________________

____________________________________________

____________________________________________

3. ____________________________________________

____________________________________________

____________________________________________

59
CHAPTER-2
RELATE
Today AI has become a part of our life. Both big and small companies are using this technology
to reduce work pressure and increase productivity. This translates into better customer
experience and comforts. AI has revolutionised every industry and field. Some of the examples
inclue:

MAJOR DEVELOPMENTS ON HOW ARTIFICIAL INTELLIGENCE (AI) HAS ENTERED INTO


OUR DAILY LIVES
Examples of AI daily lives:
 Amazon Alexa: It allows the users to do multiple tasks. Google Home: Google’s range of Smart
Speakers and AI enabled assistant. It allows the users to take advantage of Google’s online
capabilities for answering questions, managing tasks and controlling devices.
 Alpha go: Computer uses AI and play multi-game matches with humans.
 Google Allo: Mobile messaging App released by Google.
 IBM Watson: A super computer platform teams up with General Motors, announced by IBM.
Amazon Alexa Google Home Alpha go Google Allo IBM Watson

RELEVANCE OF AI IN OUR LIVES


HOW IS ARTIFICIAL INTELLIGENCE RELEVANT IN OUR LIVES?
o AI automates repetitive learning and discovery through data.
o AI augments intelligence of existing products.
o AI adapts through progressive learning algorithms to let the data to do programming.
o AI analyses more and deeper data using neural networks that have many hidden layers.
o AI achieves incredible accuracy.
o AI acquires the most out of data.

60
SMART HOME
Smart home is a technology which provides homeowners security, comfort, convenience and
energy efficiency by allowing them to control smart devices, often by a smart home app on
their smartphone or other networked device.
In other words, a smart home is a residence that uses internet-connected devices to enable the
remote monitoring and management of appliances, devices and systems, such as lighting and
heating.
A part of the internet of things (IoT), smart home systems and devices often operate together,
sharing consumer usage data among themselves and automating actions based on the
homeowners' preferences.
A Smart home has a smart devices along with AI-powered technology to provide new
possibilities

61
A smart home is a term used to describe a home that makes use of
many connected technologies, such as:

 Heating Systems.
 TV with AI.
 Smart door bells.
 Smart power switches.
 Smart kettles.
 Smart vacuum cleaners.
 Smart scales.
 Smart security cameras.

SMART CITY
A smart city is an urban development vision to integrate information and communication
technology (ICT) and Internet of things (IoT) technology in a secure way to manage a city. This
can include management of local departments' information systems, schools, libraries,
transportation systems, hospitals, power plants, water supply networks, waste management,
law enforcement, and other community services.

In addition to the regular urban infrastructure that is there in any city like office buildings,
residential areas, hospitals, schools, transportation, police and so on, you also need something
in addition to make the cities smart. So, smart means the services that are given to the
respective stake holders of these cities. So, citizens are able to do things in a better
and improved manner than usual. It is possible through the ICT technologies (information and
communication technologies).
Some of the basic components of smart city are:

 Hospitals
 Railways
 Police
 Traffic Control
 Bank
 School
 Waste Management

Summary - Smart City

 An urban system
 Uses Information and Communication Technology (ICT)
 Makes infrastructure more interactive, accessible and efficient.
 Need for smart city aroused because of
 Rapidly growing urban population & its demands

62
 Fast depleting natural resources
 Rapid change in environment & climate.

 Link for Smart cities video: https://www.youtube.com/watch?v=eRMiKt81nAE


 Link for Smart Home video: https://www.youtube.com/watch?v=1CajaUoI3vU

Interactive Story Writing (Story Speaker)


 Story Speaker is a Google Doc’s Add-on that allows people who do not know computer
programming to create talking, interactive stories.

Resources:

Link to install Story Speaker extension for Story


Speaker: https://chrome.google.com/webstore/detail/story-
speaker/ohfibfhhfbhknfdkipjdopbnegkbkjpj

Introduction to Story Speaker:


https://www.youtube.com/watch?v=wsrzvYYvhH8&feature=youtu.be

Link to read more about Story Speaker:


https://docs.google.com/d ocument/d/1hFrBtsBbF2LoZ1FFpXEH7L6fWH1lj24W1-
itXnKSXK8/edit

Basic Template of Story Speaker:


https://docs.google.com/document/d/1rXPSayQVVQ-
T5cWlhxPbOCc2UJEZTbVWkxqOnC_RnDE/edit?usp=sharing

63
Worksheet 2.1

I. Match the columns


Product What it does Company
1. Eco Dot a. Smart Lighting i. Philips
2. Hue b. Universal Remote ii. Logitech
3. Nest Hub c. Home Automation iii. Samsung
4. Harmony Elite d. Smart Display iv. Amazon
5. Smart Things e. Smart Speaker v. Google.

II. True or False


1. Amazon and Walmart use AI technology to understand their customer’s better.____________
2. AI technology does not have any risk._______________
3. Smart buildings and Smart cities help in sustainable development.__________________
4. Smart cities can lead to better disaster management and responses.___________________
5. Smart buildings do not need a number of interconnected devices._____________________
6. The development of self-driving vehicles will help in reducing accidents and
traffic jams.__________________

III. MULTIPLE-CHOICE QUESTIONS(MCQs)


1. In which of the following products does the AI play multi-game matches with human?
a. Alexa b. AlphaGo c. Allo d. AlNow
2. What is the name of the Home Assistant and series of Smart Speakers marketed by Google?
a. Google Home b. Google Go c. Google Now d. Google Future.
3. Google’s self-driving car project is called____________.
a. Alphabet b. CRUISE c. Waymo d. Mobileye
4. Siri is a digital assistant developed by _______________.
a. Microsoft b. Apple c. Google d. IBM
5. What is IBM’s Watson?
a. Self -driving vehicle c. Supercomputer platform
b. Messaging service d.Digital assistant.
6. What is the name of Google’s AI based messaging service?
a. Allo b. Helo c. Orkut d. Facebook

64
IV. Answer in brief:
1. What are the different appliances/equipments that you think can be added to Smart
buildings?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

2. What is Story Speaker?


______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

3. What are the few AI-based technologies that you are using in your day-to-day life?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

4. Write a few points on how living in Smart Cities will change your life.
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
5. Write about Smart Home?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________

65
Draw your new Smart Floor Plan here:

66
CHAPTER-3
PURPOSE
SUSTAINABLE DEVELOPMENT GOALS (SDGs)
The term ‘Sustainable development’ can mean different things to different people in different
situations. One of the most frequently used definition of sustainable development is
‘Sustainable development is the development that meets the needs of the present without
compromising the ability of future generations to meet their own needs’.

Elements of Sustainable Development


For sustainable development to be achieved, it is crucial to harmonise the three core elements:
 Economic growth
 Social inclusion
 Environmental protection
These elements are interconnected and crucial for the well-being of individuals and societies.
The issues covered under the sustainable development goals include:
 Ending extreme poverty
 Ensuring all children receive good education, achieving equal opportunities for all
 Promoting better practices for consumption and
production that will make the planet cleaner and
healthier.

This world is the home for life of people, plants and


animals. The materials and resources that the planet
provides helps us to sustain life. In order to build a better
world for everyone it is important that we take care to
conserve, preserve and protect our Shelter and the life of
those in this world. The Member States of the United
Nations have agreed to achieve 17 Sustainable
Development Goals (SDGs) by 2030.

The 17 sustainable development goals (SDGs) to transform our world:


GOAL 1: No Poverty – End poverty in all its forms everywhere
GOAL 2: Zero Hunger – End hunger, achieve food security, and improved nutrition and promote
sustainable agriculture
GOAL 3: Good Health and Well-being – Ensure healthy lives and promote well-being for all at all ages
GOAL 4: Quality Education – Ensure inclusive and equitable quality education and promote lifelong
learning opportunities for all
GOAL 5: Gender Equality – Achieve gender equality and empower all women and girls

67
GOAL 6: Clean Water and Sanitation – Ensure availability and sustainable management of water and
sanitation for all
GOAL 7: Affordable and Clean Energy – Ensure access to affordable, reliable, sustainable and modern
energy for all
GOAL 8: Decent Work and Economic Growth – Promote sustained, inclusive and sustainable
economic growth, full and productive employment and decent work for all
GOAL 9: Industry, Innovation and Infrastructure – Develop quality, reliable, sustainable and resilient
infrastructure, including regional and trans-border infrastructure to support economic development
and human well-being, with focus on affordable and equitable for all.
GOAL 10: Reduced Inequality – Reduce inequality within and among countries
GOAL 11: Sustainable Cities and Communities – make cities and human settlements safe, resilient and
sustainable
GOAL 12: Responsible Consumption and Production – achieving economic growth and sustainable
development requires that we urgently reduce our ecological footprint by changing the way we
produce and consume goods and revenues
GOAL 13: Climate Action – Take urgent actions to combat climate change and its impacts
GOAL 14: Life Below Water – The world’s oceans – their temperature, chemistry, currents and life-
driven global systems that make Earth habitable for humankind
GOAL 15: Life on Land – protect, restore and promote sustainable use of terrestrial ecosystems,
ecologically manage forests, combat desertification, halt and reverse land degradation, and halt
biodiversity loss
GOAL 16: Peace and Justice Strong Institutions – promote peaceful and inclusive societies for
sustainable development, provide access to injustice for all and build effective, accountable and
inclusive institutions at all levels
GOAL 17: Partnerships to achieve the Goal – the SDGs can only be realised with a string commitment
to global partnership and cooperation

68
WORKSHEET 3.1
I. Take a look at the pictures and try to give the theme of each picture:

1 ………….…………………………… 2 …………….………………………….. 3 ……………………………………………

4 …….………………………………….. 5 ………………………………………… 6 …………………..………………………

7 ……….……………………………….. 8 …….……………………………………… 9 …………………………………………

10 …………….………………………. 11 ……...…………………………………. 12 ………….…………………………

69
13 …………………………………………. 14 …………..…………………………. 15 ………….…………………………

16 ………..………………………………….. 17 …………………………….………………………..

II. Take a look at these pictures and answer:


Do you think that you are also responsible in making this world a better place or are you satisfied with
the things happening around you?

70
__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

__________________________________________________________________________________________

What thoughts and actions of yours will help to make the world a better place?

Write your thoughts here… Write the actions you will take...

71
WORKSHEET 3.2
MULTIPLE CHOICE QUESTIONS (MCQs)
1. Which of the following is NOT one of the three main domains of the Sustainable Development
Goals?
a. Environment c. Economy
b. Social d. Political

2. In which of the following years were the Sustainable Development Goals adopted?
a. 2010 b. 2012 c. 2015 d. 2018

3. The Sustainable Development Goal 10 deals with


a. Reducing inequalities within and among countries
b. Achieving gender equality
c. Combating climate change
d. Life on earth

4. Which of the following goals mainly deals with cities and human settlements?
a. Goal 11 b. Goal 12 c. Goal 13 d. Goal 14

5. Sustainable Development Goal primarily deals with


a. Ending poverty b. Ending hunger
c. Healthy life d. Quality education

6. Which of the following statements is/ are correct?

(i) The Sustainable Development is aimed at satisfying the needs of the present generation.

(ii) The Sustainable Development is aimed at ensuring that the needs of the future generation will be
satisfied.

a. Only (i) b. Only (ii) c. Both (i) and (ii) d. Neither (i) nor (ii)

72
CHAPTER-4
POSSIBILITIES
Possibilities of AI in various fields: Everyday influences of AI globally –

Artificial Intelligence Influences Business


Commercial establishments and big businesses, along with the government, are the drivers for
artificial intelligence development. Adopting AI-based solutions allows businesses to cut both cost
and time and provide better services and products to the customers. Leading companies in every field
are using AI solutions to stay ahead of the competition.

Life-Saving AI
Healthcare industry is using AI to improve the quality of life and save it. The developments in this field
include personalised drug treatments based on 24x7 monitoring using various sensors. Robot assisted
surgeries improve diagnosis. In the field of disaster management, these techniques are helping in
both reducing the impact of disasters and managing the post disaster rescue.

Entertaining AI
Entertainment industry is experimenting with AI to produce original music, books, recipes, etc.
Companies, like, Netflix and Spotify use Al to predict what the users would like to watch or listen.

ILLUSTRATION OF SMART LIVING

VISIT TO AN AI-ENABLED HOSPITAL IN A SMART CITY


The development in the field of AI will also change the manner in which we interact
with our environment. Modern AI systems use various sensors, cameras. speakers,
microphones, etc., for better interactions. These systems know what we are doing what our
preferences are and help make our life better. Let us look at how this happens by imagining a visit to
a hospital.

SETTING 1:
You walk into the reception area of the hospital. The hospital Al controller recognises you based on
your earlier visits to the hospital. It already knows the patient you have come to see. It checks and
sees if your name is still on the list of visitors who are allowed to see the patient. You approach the
reception and the AI notices that you are breathing hard and you are empty handed. The reception
robot asks you if you would like to go directly to meet the patient. get something to drink at the
canteen or visit the gift shops in the hospital. You tell the robot that you would like to visit the
canteen and then go to the gift shop before visiting the patient.

73
SETTING 2:
The hospital AI updates your smart device with the directions to the canteen and gift shop.
You visit the canteen and pick up a soda from the beverages section. The payment for the soda is
automatically deducted from your account. The cafeteria AI system records different things like the
weather, time, your reason for visiting. etc. This data will be used to make your future visits even
more comfortable.

SETTING 3:
The gift shop AI talks to the Hospital AI and finds out that the patient you are visiting is a five years
old girl and that you arrived empty handed to the Hospital. The AI also checks with the Hospital AI to
find out the items that are appropriate for the patient (for example due to allergies, medications,
etc.) The robot at the gift shop shows you a different range of items suited for a five-year old girl.

SETTING 4:
You use the smart device to check the route to the patient's room and head towards it. On reaching
the patient room you are informed that the visiting hours would end at 6:00 PM. You are unable to
access the latest charts of the patient because you are not a close relative.

SKILL SETS NEEDED FOR JOBS IN AI FIELD

The growth and development of Artificial Intelligence (AI) has increased the demand for specific jobs
in the industry. It has created a situation in which there is critical shortage of trained individuals in
certain areas. Most of the artificial intelligence related jobs require knowledge of computers and
math. The entry level jobs require graduation. Advanced jobs require post-graduation or doctorates.
The field of study depends on the category of jobs.

TYPES OF AI CAREERS

AI careers can be of two types. The first relates to developing and deploying AI systems. These are
highly specialised jobs that require advance training and education. The second are related to
operating AI systems. For these kinds of jobs the entry level requirements are comparatively lower.

The careers related to the core development and deployment of AI systems include:
Software analysts Computer engineers
Software developers Algorithm specialists
Computer scientists

In addition, the development and deployment of AI Systems need specialists from different areas and
fields. These careers help in the development of AI systems related to their fields.
Mechanical, manufacturing, electrical engineers Graphic designers
Medical professionals Musicians and other entertainment specialists
74
Defence specialists Architects
Companies that hire top AI talent range from start-ups like Argo AI to tech giants like IBM. Following
are the leading employers who have hired top AI talent over the past years.

SKILL SET IN DEMAND FOR THE JOBS IN AI


Here are a few Of the specific Al careers along with the skill set required for them:

1. MACHINE LEARNING ENGINEER: These engineers develop and manage machine learning projects.

2. DATA SCIENTIST: Data scientists are scientists who work with data. They collect, analyse, and draw
interpretations from huge datasets.

3. BUSINESS INTELLIGENCE DEVELOPER: They analyse data to identify business and market trends.
This involves designing, modelling, analysing interpretation, maintenance, etc., Of data sets.

4. RESEARCH SCIENTIST: Research scientist is related to research in the field of artificial intelligence.
They research and advance our knowledge of Als.

75
WORKSHEET 4.1

Activity 1. Emergence of AI in different spheres of everyday life.


You are to research and note down emerging trends in each of these spheres. You can also find out
the new developments pertaining to AI in these fields, companies that are working on such
developments.

____________________________________________________
____________________________________________________
HEALTH
____________________________________________________
____________________________________________________

____________________________________________________
___________________________________________________
SECURITY
____________________________________________________
_____________________________________________________

____________________________________________________
____________________________________________________
EDUCATION
____________________________________________________
____________________________________________________

_____ ___________________________________________________
___________________________________________________
TRANSPORTATION
___________________________________________________
___________________________________________________

_______ ___________________________________________________
___________________________________________________
ENTERTAINMENT
___________________________________________________
___________________________________________________
76
Activity 2. [Group Activity – Groups of 4]
To make a Poster for a Future Job Advertisement in which you need to mention what job are you
recruiting for and what skill sets is expected in the candidate. Make the poster as creative as possible.
It should be futuristic and should talk about the period 10 years in the future.

Here’s what you have to do:

● Search for current and emerging trends in employment to make a Future Job
Advertisement.
● The job description is for a job which will exist ten years from now, i.e. the current date.
● To help you, the job advertisement must include the following information.

List the kinds of futuristic job opportunities that Write the skills you require to do these jobs?
would be available for you?

77
Make a Job Advertisement for the Future here:

78
Activity 3. SMART LIVING – Studying in an AI enabled smart school.
You have already seen an illustration about visiting an AI enabled hospital in a Smart City. Now
imagine that you are studying in an AI-enabled smart school. What will be your experience of
studying in such an institution?
SETTING 1: YOU ENTER THE SCHOOL AND ATTEND THE FIRST PERIOD (MATHEMATICS):
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

SETTING 2: EXPERIENCE IN THE SCHOOL CANTEEN DURING SHORT BREAK:


_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
SETTING 3: PARENT - TEACHER MEETING:
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

79
CHAPTER-5
AI ETHICS
ETHICAL CONCERNS RELATED TO AI ACCESS
AI ethical concerns can be divided into two parts:

PRIVACY CONCERNS OF AI SYSTEMS:

One of the most serious implications of data collection is related to Privacy Concerns. Take a simple
example of your Android Smart Phone. The following is a list of some information that Google
possesses about you (if you have given it permission).
1. Contact List: All of the numbers on your phone along with the names. Google knows who are
your
favourite (based on the amount of time you spend talking to them), the best time to call you, the
people who you do not like to talk to (i.e., you do not take their calls, or you cut them) etc.
2. Location: Google knows when you leave for school, the route which you take, the time you spend
in school, the route you take back, the shops that you like to visit, the park where you go for walk,
the restaurant where you eat, etc.
3. E-mail: The complete list of all the mails sent and received by you (including the ones you
deleted). Every personal and official mail.
4. Hangout: All Of your chat records.
5. Photos: All the images of you and your friends along with their names. Linked with contact list
Google knows their phone numbers, email-IDs, addresses, etc. Linked with calendar it also knows
about important events like their birthdays, marriage anniversaries. birth of their children, etc.

Most of the time, we accept lengthy user agreements without even realising the implications of
these agreements on our privacy rights. Data related to us is stored somewhere in some large
databases. This data can be used for a number of purposes.
The information is collected in lieu of providing us with helpful services, but the potential risk here
is very high. For example, take the facial recognition system. The AI system can use this technology
along with the information provided by Apps like Contact and Photos to create a wide surveillance
network that can monitor you 24 X 7.

COMPONENTS OF A GOOD AI POLICY


A good AI policy must have five components:
 The AI system must be transparent.
 An AI must have the right to the information it is collecting.
 Consumers must have a choice of leaving the system.
 The data collected and the purpose of the AI must be limited by design.
 Data must be deleted upon consumer request.
80
ETHICAL CONCERNS RELATED TO ADOPTION OF AI SYSTEMS
Major concerns related to the adoption of AI Systems is:
1. JOB LOSS: For a long time now, people have been arguing about the number of the jobs that will
be lost due to adoption of AI systems and advanced robots.

2. INCREASING INEQUALITIES: The current economic system provides economic rewards based on
contributions to the economy. The AI era will reduce the number of people required for doing
jobs. This will also reduce economic remuneration given to them. In this case. most of the
economic benefits will go to companies who own AI systems. This will further widen the already
wide income gaps.

3. NEGATIVE ADOPTIONS: AI technologies, like all the other technologies, can be used for both
good and evil. This technology in the hands of terrorists, can be used to spread terror. They can
use AI based technologies to make attacks that can do most damage in terms of life and
infrastructure losses. Cyber criminals can use AI technology to hack into more systems and for
doing more damage. Countries can use this technology to increase war damages inflicted by
them.

4. BLACK BOX PROBLEM: Black Box problem refers to inherent problems of the AI systems.
Sometime what happens in the AI system is normally not easily understood by common
individuals and not even by the programmers. This problem stems out of the fact that AI systems
do not provide reasoning for decisions made by them

Every technological development can be used for the benefits of the mankind as well as for its
destruction. We Can use dynamites to make mining easy and we can also use them as weapons.
Nuclear power can be used to create energy and it can also be used to destroy cities and countries.
Advancement in medicines can be used to heal and improve the quality of life of human beings as
well as to create biological weapons. AI technology is no different. It can be used for the good of
the mankind or for its destruction.
Overall, the society will have to Come up with ethical guidelines on data and A1 Systems as it has
done for many of the other technologies. The violations of these guidelines. rules or regulations
will have to be punished appropriately.

81
WORKSHEET 5.1

I. True or False
1. Ethics is only concerned with what is good for the individuals. _______________
2. The facial recognition system can be used for creating 24 X 7 wide surveillance systems.
________
3. In a good Al system. consumers have a right to adopt out of the system. ________________
4. Al ethics are the system of moral principles which guide the Al in decisions making.___________
5. Widescale adoption of Al technologies can lead to widening of income gap in the society.______
6. The benefits of the Al systems are always more than the ethical concerns related to them.
______
II. MULTIPLE CHOICE QUESTIONS(MCQs):
1. What is Al Black Box problem?
a. Al systems do not explain their reasoning.
b. Al system design is difficult to understand.
c. Al system data is stored in black boxes which can be easily hacked.
d. Al systems cannot differentiate between right and wrong.

2. What is the most serious Al ethical concern related to Data?


a. Faulty data b. Overflowing data
c. Biased data d. Irrelevant data

3. A good Al system
a. Must not be transparent
b. Must not delete data even upon the consumer requests
c. Must not allow consumers to leave the system
d. Must not collect information to which it does not have a right

4. Which of the following statements is correct?


a. Al technology will lead to more jobs loss than it would create
b. Job loss due to Al technology will be more than the jobs created by Al technology
c. The adoption of Al technology will cause Al to take over many jobs currently performed by
human beings
d. Al technology will not cause job losses

82
WORKSHEET 5.2

Activity 1. AI BALLOON DEBATE


Debate about the boon and bane of various AI applications in the different industries that was
researched about. Each theme has been given to two different teams. One team out of these two
will be in affirmation with AI applications in their theme while the other one will be against AI
applications in the same theme. The debate will go theme by theme wherein each member of the
team will get a minute to speak. The first speaker of the affirmative team will start the debate after
which the first speaker of the rebuttal team will put their points. In this manner, each speaker will
get a minute to speak and finally one team will be chosen to be thrown out of the balloon debate
depending upon how convincing their points were.

THEME : ________________________________

POINTS FOR THE DEBATE:

____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________

83

You might also like