0% found this document useful (0 votes)
49 views

CPS Module-5

The document discusses structures in C programming. It defines a structure as a user-defined data type that allows storing different data types together. Structures have members that are accessed using the dot operator. The document provides examples of declaring structure variables, initializing structure members, arrays of structures, and pointers to structures. It explains that structures allow organizing related data and accessing members by name rather than position in memory.

Uploaded by

Mani Mala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

CPS Module-5

The document discusses structures in C programming. It defines a structure as a user-defined data type that allows storing different data types together. Structures have members that are accessed using the dot operator. The document provides examples of declaring structure variables, initializing structure members, arrays of structures, and pointers to structures. It explains that structures allow organizing related data and accessing members by name rather than position in memory.

Uploaded by

Mani Mala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

MODULE 5

STRUCTURE :

Why we use structure?

o If I have to write a program to store Student information, which will have Student's name,
age, branch, permanent address, father's name etc., which included string values, integer
values etc. I use arrays for this problem, I will require something which can hold data of
different types together.
o Construct individual arrays for storing names, roll numbers, and marks.
o Can use a special data structure to store the collection of different data types.

Definition of Structure:

Structure in c is a user-defined data type that enables us to store the collection of different data
types. Each element of a structure is called a member (or) Structure is a user-defined datatype in
C language which allows us to combine data of different types together. Each element of a
structure is called a member. struct keyword is used to define the structure

Syntax: struct structure_name

{
data_type member1;
data_type member2;
.
.
data_type memeberN;
} structure variables;
Example :1
struct employee
{
int id;
char name[20];
float salary;
} emp;

Example :2
struct student
{
int stusn;
char stname[20];
float marks;
} stud;
Here, struct is the keyword; employee is the name of the structure; id, name, and salary are the
members or fields of the structure. Let's understand it by the diagram given below:

Declaring structure variable

We can declare a variable for the structure so that we can access the member of the structure
easily. There are two ways to declare structure variable:
1. By struct keyword within main() function
2. By declaring a variable at the time of defining the structure.

Way 1: By struct keyword within main() function

The example to declare the structure variable by struct keyword. It should be declared within the
main function.
struct employee
{ int id;
char name[50];
float salary;
};

Now write given code inside the main() function.

Example Program :
#include<stdio.h>
struct employee
{
int empid;
char empname[50];
float empsalary;
};
void main( )
{
struct employee emp;
printf("Enter the Employee id :");
scanf("%d",&emp.empid);
printf("Enter the Employee Name :");
scanf("%s",&emp.empname);
printf("Enter the Employee salary :");
scanf("%f",&emp.empsalary);
printf("The Employee details are : \n");
printf("The Employee id is : %d\n",emp.empid);
printf("The Employee Name is :%s\n",emp.empname);
printf("The Employee salary is:%.2f\n",emp.empsalary);
}
Output:

Way : 2 By declaring a variable at the time of defining the structure.

The another way to declare variable at the time of defining the structure.

struct employee
{
int id;
char name[50];
float salary;
}e1,e2;

Example Program:

#include<stdio.h>
struct employee
{ int empid;
char empname[50];
float empsalary;
}emp; //declaring e1 variable for structure
void main( )
{
//store employee information
printf("Enter the Employee id :");
scanf("%d",&emp.empid);
printf("Enter the Employee Name :");
scanf("%s",&emp.empname);
printf("Enter the Employee salary :");
scanf("%f",&emp.empsalary);
printf("The Employee details are : \n");
printf("The Employee id is : %d\n",emp.empid);
printf("The Employee Name is :%s\n",emp.empname);
printf("The Employee salary is:%.2f\n",emp.empsalary);
}
Output:

Accessing Structure Members


Structure members can be accessed and assigned values in a number of ways. Structure members
have no meaning individually without the structure. In order to assign a value to any structure
member, the member name must be linked with the structure variable using a dot . operator also
called period or member access operator.
Method 1:
#include<stdio.h>
struct book
{
int bookid;
char authorname[50];
float price;
};
void main( )
{
struct book bk;
bk.bookid = 1023;
bk.authorname[50] = "Dennis";
bk.price = 2000.00;
printf("The book details are : \n");
printf("The book id is : %d\n",bk.bookid);
printf("The author name is :%s\n",bk.authorname);
printf("The bookprice is:%.2f\n",bk.price);
}
Output :
The book details are :
The book id is : 1023
The author name is : Dennis
The bookprice is : 2000.00
or
#include<stdio.h>
struct book
{
int bookid;
char authorname[50];
float price;
};
void main( )
{
struct book bk;
printf("Enter the book id :");
scanf("%d",&bk.bookid);
printf("Enter the author Name :");
scanf("%s",bk.authorname);
printf("Enter the bookprice :");
scanf("%f",&bk.price);
printf("The book details are : \n");
printf("The book id is : %d\n",bk.bookid);
printf("The author name is :%s\n",bk.authorname);
printf("The bookprice is:%.2f\n",bk.price);
}
Output :
The book details are :
The book id is : 1023
The author name is : Dennis
The bookprice is : 2000.00
Initializing structure Members :
We can initialize the structure members directly like below,
Like a variable of any other datatype, structure variable can also be initialized at compile time.
struct patient
{
float height;
int weight;
int age;
};
struct patient p1 = { 180.75 , 73, 23 }; //initialization

(or)

struct Patient p1;


p1.height = 180.75; //initialization of each member separately
p1.weight = 73;
p1.age = 23;
Example:1

#include<stdio.h>
void main()
{
struct car
{
char name[100];
float price;
};
// car1.name -> "xyz"
//car1.price -> 987432.50
struct car car1 ={"xyz", 987432.50};
//printing values using dot(.) or 'member access' operator
printf("Name of car1 = %s\n",car1.name);
printf("Price of car1 = %f\n",car1.price);
}
Output:
xyz
987432.50

Example 2:
#include<stdio.h>
void main()
{
struct car
{
char name[100];
float price;
};
void main()
{
struct car car1;
car1.name="xyz";

car1.price =987432.50;

//printing values using dot(.) or 'member access' operator


printf("Name of car1 = %s\n",car1.name);
printf("Price of car1 = %f\n",car1.price);
}
Output:
xyz
987432.50

Rules for Initializing structures:

1.We cannot initialize individual members inside the structure template.


2.The order of values enclosed in braces must match the order of members in the structure
definition
3.It is permitted to have a partial initialization. We can initialize only the first few members and
leave remaining blank. The uninitialized members should be at the end of the list.
4.The uninitialized members will be assigned default value as follows:
Zero for integer and floating point numbers
‘\0’ for character and strings

Array of Structures :
An array of structres in C can be defined as the collection of multiple structures variables where
each variable contains information about different entities. The array of structures in C are used
to store information about multiple entities of different data types. The array of structures is also
known as the collection of structures.
Example:

struct car
{
char make[20];
char model[30];
int year;
};

struct car arr_car[10];


Example:
#include<stdio.h>
struct student
{
int rollno;
char name[10];
};
void main()
{
int i,n;
struct student st[3];
printf("Enter the number of students:");
scanf("%d",&n);
printf("Enter Records of students");
for(i=0;i<n;i++)
{
printf("\nEnter Rollno:");
scanf("%d",&st[i].rollno);
printf("Enter Name:");
scanf("%s",&st[i].name);
}
printf("\nStudent Information List:");
for(i=0;i<n;i++)
{
printf("\nRollno:%d, Name:%s",st[i].rollno,st[i].name);
}
}
Output:
Explanation :
In the above program, we have stored data of 3 students in the structure. However, the complexity
of the program will be increased if there are 20 students. In that case, we will have to declare 20
different structure variables and store them one by one. This will always be tough since we will
have to declare a variable every time we add a student. Remembering the name of all the variables
is also a very tricky task. However, c enables us to declare an array of structures by using which,
we can avoid declaring the different structure variables; instead we can make a collection
containing all the structures that store the information of different entities.
Array in Structures :
Arrays may be the member within structure, this is known as arrays within
structure. Accessing arrays within structure is similar to accessing other members.
Here in the example, we have two arrays in the structure
name[10], subjectname[20].
Example :
#include<stdio.h>
struct collegestudent
{
int rollno;
char name[10];
char subjectname[20];
};
void main()
{
int i,n;
struct collegestudent stud[3];
printf("Enter the number of students:");
scanf("%d",&n);
printf("Enter Records of students");
for(i=0;i<n;i++)
{
printf("\nEnter Rollno:");
scanf("%d",&stud[i].rollno);
printf("\nEnter Name:");
scanf("%s",stud[i].name);
printf("\nEnter subject Name:");
scanf("%s",stud[i].subjectname);
}
printf("\nStudent Information List:");
for(i=0;i<n;i++)
{
printf("\nRollno:%d, Name:%s,
SubjectName:%s",stud[i].rollno,stud[i].name,stud[i].subjectname);
}
}
Output:
Enter the number of students: 2
Enter Records of students
Enter Rollno : 121
Enter Name : Arnavi
Enter subject name: C Programming
Enter Records of students
Enter Rollno : 141
Enter Name : Anith
Enter subject name: Problem Solving
Student Information List:
Rollno: 121, Name: Arnavi, SubjectName: C Programming
Rollno: 141, Name: Anith, SubjectName: Problem Solving

C Pointers

Definition: The pointer in C language is a variable which stores the address of another variable.
This variable can be of type int, char, array, function, or any other pointer. In simple A pointer is
a variable in C, and pointers value is the address of a memory location. (Or)

POINTER is a variable that stores address of another variable. A pointer can also be used to
refer to another pointer function. A pointer can be incremented/decremented, i.e., to point to the
next/ previous memory location. The purpose of pointer is to save memory space and achieve
faster execution time.

Declaring a pointer

Like variables, pointers have to be declared before they can be used in the program. Pointers can
be named is user defined. A pointer declaration has the following form.

data_type * pointer_variable_name;

Here,

 data_type is the pointer's base type of C's variable types and indicates the type of the
variable that the pointer points to.
 The pointer in c language can be declared using * (asterisk symbol). It is also known as
indirection pointer used to dereference a pointer.
 Pointer_variabe_name is user defined pointer variable name.

Example:

int *ptr1; /* pointer to an integer */


int *ptr1, var;/* ptr1 is a pointer to type integer and var is an integer variable */
double *ptr2; /* pointer to a double */
float *ptr3; /* pointer to a float */
char *ch1 ; /* pointer to a character */
float *ptr, variable; /*ptr is a pointer to type float and variable is an ordinary float variable */
Consider the following example to define a pointer which stores the address of an integer.
int n = 10;
int* p = &n; // Variable p of type pointer is pointing to the address of the variable n of type
integer

Assigning address to pointers:


int *pc,c;
c=5;
pc=&c

Here, 5 is assigned to the c variable. And, the address of c is assigned to the pc pointer.

VARIABLE POINTER

A value stored in a named storage/memory A variable that points to the storage/memory


address address of another variable

Example :

#include <stdio.h>
void main()
{
/* Pointer of integer type, this can hold the
* address of a integer type variable. */
int *p;
int var = 10;
/* Assigning the address of variable var to the pointer
* p. The p can hold the address of var because var is
* an integer type variable. */
p= &var;
printf("Value of variable var is: %d", var);
printf("\nValue of variable var is: %d", *p);
printf("\nAddress of variable var is: %p", &var);
printf("\nAddress of variable var is: %p", p);
printf("\nAddress of pointer p is: %p", &p);
}
Output:
Explanation :

Example :
#include <stdio.h>
void main()
{
int* pc, c;
c = 22;
printf("Address of c: %x\n", &c);
printf("Value of c: %d\n\n", c); // 22
pc = &c;
printf("Address of pointer pc: %x\n", pc);
printf("Content of pointer pc: %d\n\n", *pc); // 22
c = 11;
printf("Address of pointer pc: %x\n", pc);
printf("Content of pointer pc: %d\n\n", *pc); // 11
*pc = 2;
printf("Address of c: %x\n", &c);
printf("Value of c: %d\n\n", c); // 2}
}
Output:

Addition of two numbers using pointers:


#include <stdio.h>
void main()
{
int first, second, *p, *q, sum;

printf("Enter two integers to add\n");


scanf("%d%d", &first, &second);

p = &first;
q = &second;

sum = *p + *q;

printf("Sum of entered numbers = %d\n",sum);

Output:

In this program there are two integer variables x, y and two pointer variables p and q.
Assign the addresses of x and y to p and q respectively and then assign the sum of x and y to
variable sum. & is address of operator and * is value at address operator.

Accessing the value of a variable using pointer in C


A pointer is a special type of variable that is used to store the memory address of another variable.
A normal variable contains the value of any type like int, char, float etc, while a pointer variable
contains the memory address of another variable.

Steps:

1. Declare a normal variable, assign the value


2. Declare a pointer variable with the same type as the normal variable
3. Initialize the pointer variable with the address of normal variable
4. Access the value of the variable by using asterisk (*) - it is known as dereference
operator

Example:

Here, we have declared a normal integer variable num and pointer variable ptr, ptr is being
initialized with the address of num and finally getting the value of num using pointer
variable ptr.
#include <stdio.h>
int main()
{ //normal variable
int num = 100;
//pointer variable
int *ptr;
//pointer initialization
ptr = &num;
//pritning the value
printf("value of num = %d\n", *ptr);
}

Output:

Value of num = 100

Advantage of pointer

1) Pointer reduces the code and improves the performance, it is used to retrieving strings,
trees, etc. and used with arrays, structures, and functions.

2) We can return multiple values from a function using the pointer.

3) It makes you able to access any memory location in the computer's memory.

Declaring a pointer

Like variables, pointers have to be declared before they can be used in the program. Pointers can
be named is user defined. A pointer declaration has the following form.

data_type * pointer_variable_name;

Here,

 data_type is the pointer's base type of C's variable types and indicates the type of the
variable that the pointer points to.
 The pointer in c language can be declared using * (asterisk symbol). It is also known as
indirection pointer used to dereference a pointer.
 Pointer_variabe_name is user defined pointer variable name.

Example:

int *ptr1; /* pointer to an integer */


int *ptr1,var;/* ptr1 is a pointer to type integer and var is an integer variable */
double *ptr2; /* pointer to a double */

Example :

#include<stdio.h>
void main ()
{
int var = 20; /* actual variable declaration */
int *ip; /* pointer variable declaration */
ip = &var; /* store address of var in pointer variable*/
printf("Address of var variable: %x\n", &var );
/* access the value using the pointer */
printf("Value of *ip variable: %d\n", *ip );
}
Output:

Initialization of C Pointer variable :


Pointer Initialization is the process of assigning address of a variable to a pointer variable.
Pointer variable can only contain address of a variable of the same data type. In C
language address operator & is used to determine the address of a variable.
The & (immediately preceding a variable name) returns the address of the variable associated
with it.

Examples to initialize pointer variable

int num = 10;

int *ptr = &num; // Assign address of num to ptr

Example 1:
#include <stdio.h>
void main()
{
int i = 10; // normal integer variable storing value 10
int *a; // since '*' is used, hence its a pointer variable
/* '&' returns the address of the variable 'i' which is stored in the pointer variable 'a' */
a = &i;
/* below, address of variable 'i', which is stored by a pointer variable 'a' is displayed */
printf("Address of variable i is %u\n", a);
/* below, '*a' is read as 'value at a' which is 10 */
printf("Value at the address, which is stored by pointer variable a is %d\n", *a);
}
Output :

Example Programs :
Example: 1
C program to create, initialize, assign and access a pointer variable :
#include <stdio.h>
void main()
{
int num; /*declaration of integer variable*/
int *pNum; /*declaration of integer pointer*/
pNum=&num; /*assigning address of num*/
num=100; /*assigning 100 to variable num*/
//access value and address using variable num
printf("Using variable num:\n");
printf("value of num: %d\naddress of num: %u\n",num,&num);
//access value and address using pointer variable num
printf("Using pointer variable:\n");
printf("value of num: %d\naddress of num: %u\n",*pNum,pNum);
}
Output

Example: 2
// function : swap two numbers using pointers
void swap(int *a,int *b)
{
int t;
t = *a;
*a = *b;
*b = t;
}
void main()
{
int num1,num2;
printf("Enter value of num1: ");
scanf("%d",&num1);
printf("Enter value of num2: ");
scanf("%d",&num2);
//print values before swapping
printf("Before Swapping: num1=%d, num2=%d\n",num1,num2);
//call function by passing addresses of num1 and num2
swap(&num1,&num2);
//print values after swapping
printf("After Swapping: num1=%d, num2=%d\n",num1,num2);
}
Output:

Freezing Temperature of Seawater


Definition:
The freezing point of sea water depends on salinity and pressure. Millero and Leung (Millero &
Leung 1976) give a formula for the calculation of this temperature. Here a function is given to
compute the freezing point in °F for seawater at given values of practical salinity

Write a C program for calculating Freezing Temperature of Seawater


#include<stdio.h>
main()
{
float a,b,c;
float fa,fb,fc;
printf("enter the Temp a \n");
scanf("%f", &a);
printf("enter the Temp fa\n");
scanf("%f", &fa);
printf("enter the Temp b \n");
scanf("%f", &b);
printf("enter the Temp c \n");
scanf("%f", &c);
printf("enter the Temp c and fc\n");
scanf("%f", &fc);
//calculation of Freezing Temperature
fb=fa+((b-a)/(c-a))*(fc-fa);
printf("The New Freezing Temperature is %f ",fb);
}

Sample Output :
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

TOPIC: ARTIFICIAL INTELLIGENCE

Definition:
According to the father of Artificial Intelligence, John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a software
think intelligently, in the similar manner the intelligent humans think.
AI is accomplished by studying how human brain thinks and how humans learn, decide, and work
while trying to solve a problem, and then using the outcomes of this study as a basis of developing
intelligent software and systems.

What Contributes AI:


Artificial intelligence is a science and technology based on disciplines such as Computer Science,
Biology, Psychology, Linguistics, Mathematics, and Engineering. A major thrust of AI is in the
development of computer functions associated with human intelligence, such as reasoning,
learning, and problem solving.
Out of the following areas, one or multiple areas can contribute to build an intelligent system.

Applications:
AI has been dominant in various fields such as −
Gaming − AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc., where
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

machine can think of large number of possible positions based on heuristic knowledge.
Natural Language Processing − It is possible to interact with the computer that understands
natural language spoken by humans.
Expert Systems − There are some applications which integrate machine, software, and special
information to impart reasoning and advising. They provide explanation and advice to the users.
Vision Systems − These systems understand, interpret, and comprehend visual input on the
computer. For example,
 A spying airplane takes photographs, which are used to figure out spatial information or
map of the areas.
 Doctors use clinical expert system to diagnose the patient.
 Police use computer software that can recognize the face of criminal with the stored portrait
made by forensic artist.
Speech Recognition − Some intelligent systems are capable of hearing and comprehending the
language in terms of sentences and their meanings while a human talks to it. It can handle different
accents, slang words, noise in the background, change in human’s noise due to cold, etc.
Handwriting Recognition − The handwriting recognition software reads the text written on paper
by a pen or on screen by a stylus. It can recognize the shapes of the letters and convert it into
editable text.
Intelligent Robots − Robots are able to perform the tasks given by a human. They have sensors to
detect physical data from the real world such as light, heat, temperature, movement, sound, bump,
and pressure. They have efficient processors, multiple sensors and huge memory, to exhibit
intelligence. In addition, they are capable of learning from their mistakes and they can adapt to the
new environment.

Examples

1. Siri--She's the friendly voice-activated computer that we interact with on a daily basis. She helps
us find information, gives us directions, add events to our calendars, helps us send messages and so
on. Siri is a pseudo-intelligent digital personal assistant.

2. Alexa--When Amazon first introduced Alexa, it took much of the world by storm. However, it's
usefulness and its uncanny ability to decipher speech from anywhere in the room has made it a
revolutionary product that can help us scour the web for information, shop, schedule appointments,
set alarms and a million other things, but also help power our smart homes and be a conduit for
those that might have limited mobility.

3. Tesla--because of its predictive capabilities, self-driving features and sheer technological


"coolness."
4. Netflix--Netflix provides highly accurate predictive technology based on customer's reactions to
films. It analyzes billions of records to suggest films that you might like based on your previous
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

reactions and choices of films. This tech is getting smarter and smarter by the year as the dataset
grows.

TOPIC: ANDROID APPLICATION

Definition
Powerful and open platform for mobile application development.
 Android is an Open source software stack
 Operating System
 Middlewares
 Set of API Libraries for writing application
 Built on open source Linux Kernel.
 Hardware access is available to all applications through API Libraries and Application
interaction.
 All applications have equal standing.
 Android applications are normally written in java
 Use its own custom virtual machine Dalvik Virtual Machine
 Android SDK includes everything we need to start developing, testing and debugging
applications.

Diagram showing main components


An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Description/Working

Android an open platform for Mobile Development

 Android is an ecosystem that combines


 A free open source OS for embedded devices
 An open source development platform for creating applications
 Devices like smart phones and tablets that run android OS and applications created
for it.
 It also contains
 Compatibility Definition Document(CDD) and Compatibility Test Suite(CTS)
 A linux OS kernel
 Open source libraries for application development
 SQLite, OpenGL...
 Dalvik Virtual Machine
 Application Framework : Windows Manager, Location Manager
 User interface framework
 Core pre-installed applications
 A SDK

Main SDK Features


1. GSM, EDGE, 3G, 4G..For telephony and data transfer.
2. Data transfer using Wi-Fi, Bluetooth and NFC between paired devices.
3. Embedded map support.
4. Location based services ->GPS, Google’s network-based location technology
5. Geocoding
6. Full multimedia hardware control.
7. APIs for using sensor hardware.
8. Inter Process Communication and Shared data mainly using Intents and Content Providers
9. Support Background Service processing use Notification
10. Home screen widgets and live wall papers
11. Ability to integrate application search results into system searches.
12. SQLite Database for data storage and retrieval using Content Providers

Android SDK includes:


 The Android APIs
 The core of SDK that provide developer access to Android stack.
 Development tools
 Let compile and debug the applications.
 The Android Virtual Device Manager and emulator
 Android emulator is a fully interactive mobile device emulator
 Runs within AVD that simulates a device hardware configuration
 We can get the feel how an application will look and behave on a real Android
device.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

 Full documentation
 SDK include extensive code level reference information.
 Include developer guide
 Sample code
 Online support

Applications
The current stable version is Android 10, released on September 3, 2019. The core Android source
code is known as Android Open Source Project (AOSP), which is primarily licensed under
the Apache License.
 Smart Phones.
 A range of other electronics, such as game consoles, digital cameras, PCs and others,
each with a specialized user interface.
 Well known derivatives include Android TV for televisions and Wear OS for wearables,
both developed by Google.

Google Play
 Is a digital distribution service operated and developed by Google.
 It serves as the official app store for the Android operating system, allowing users to browse
and download applications developed with the Android software development kit (SDK)
and published through Google.
 Google Play also serves as a digital media store, offering music, books, movies, and
television programs.
 Applications are available through Google Play either free of charge or at a cost.
 They can be downloaded directly on an Android device through the Play Store mobile
app or by deploying the application to a device from the Google Play website.

Examples

1. Facebook Integration
2. Open File chooser with Camera option in Webview File option
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

TOPIC:BIG DATA ANALYTICS

Definition:
Big Data is nothing but a large volume of data. Data could be of any kind i.e. structured data like
numbers, dates, group of words etc., semi-structured json, XML etc., or unstructured data like text,
images, videos etc. It is so difficult to process this data using a traditional database. The data can be
collected from various sources like social media, emails, banking transactions, online shopping,
mobile devices, and many other sources. This data when gathered, manipulated, stored and
analyzed, can help organizations to gain useful insights to increase their revenue, gain new and
retain old customers and improve operations.

Examples Of Big Data


Following are some the examples of Big Data-
1. The New York Stock Exchange generates about one terabyte of new trade data per day.

2. Social Media
The statistic shows that 500+terabytes of new data get ingested into the databases of social media
site Facebook, every day. This data is mainly generated in terms of photo and video uploads,
message exchanges, putting comments etc.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

3. A single Jet engine can generate 10+terabytes of data in 30 minutes of flight time. With many
thousand flights per day, generation of data reaches up to many Petabytes.

Types Of Big Data

BigData' could be found in three forms:


1.Structured
2.Unstructured
3.Semi-structured

Applications
In Banking: The use of customer data invariably raises privacy issues. By uncovering hidden
connections between seemingly unrelated pieces of data, big data analytics could potentially reveal
sensitive personal information.
In Credit Cards: Credit card companies rely on the speed and accuracy of in-database analytics to
identify possible fraudulent transactions. By storing years’ worth of usage data, they can flag
atypical amounts, locations, and retailers, and follow up with cardholders before authorizing
suspicious activity.
In Data Mining: Decision trees illustrate the strengths of relationships and dependencies within data
and are often used to determine what common attributes influence outcomes such as disease risk,
fraud risk, purchases and online signups.
In Agriculture: The data environment constantly adjusts to changes in the attributes of various data
it collects, including temperature, water levels, soil composition, growth, output, and gene
sequencing of each plant in the test bed.
In Enterprise: For enterprises around the world, in many industries, in-database analytics are
providing a competitive advantage.
Characteristics Of Big Data
(i) Volume – The name Big Data itself is related to a size which is enormous. Size of data plays a
very crucial role in determining value out of data. Also, whether a particular data can actually be
considered as a Big Data or not, is dependent upon the volume of data. Hence, 'Volume' is one
characteristic which needs to be considered while dealing with Big Data.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

(ii) Variety – The next aspect of Big Data is its variety.


Variety refers to heterogeneous sources and the nature of data, both structured and unstructured.
During earlier days, spreadsheets and databases were the only sources of data considered by most of
the applications. Nowadays, data in the form of emails, photos, videos, monitoring devices, PDFs,
audio, etc. are also being considered in the analysis applications. This variety of unstructured data
poses certain issues for storage, mining and analyzing data.
(iii) Velocity – The term 'velocity' refers to the speed of generation of data. How fast the data is
generated and processed to meet the demands, determines real potential in the data.
Big Data Velocity deals with the speed at which data flows in from sources like business processes,
application logs, networks, and social media sites, sensors, Mobile devices, etc. The flow of data is
massive and continuous.
(iv) Variability – This refers to the inconsistency which can be shown by the data at times, thus
hampering the process of being able to handle and manage the data effectively.

TOPIC: CLOUD COMPUTING

Definition:
Cloud computing is a type of computing that relies on shared computing resources rather than
having local servers or personal devices to handle applications.
In its most simple description, cloud computing is taking services ("cloud services") and moving
them outside an organization's firewall. Applications, storage and other services are accessed via
the Web. The services are delivered and used over the Internet and are paid for by
the cloud customer on an as-needed or pay-per-use business model.

Characteristics of Cloud Environments:


According to the NIST, all true cloud environments have five key characteristics:

1. On-demand self-service: This means that cloud customers can sign up for, pay for and start
using cloud resources very quickly on their own without help from a sales agent.

2. Broad network access: Customers access cloud services via the Internet.

3. Resource pooling: Many different customers (individuals, organizations or different


departments within an organization) all use the same servers, storage or other computing
resources.

4. Rapid elasticity or expansion: Cloud customers can easily scale their use of resources up or
down as their needs change.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

5. Measured service: Customers pay for the amount of resources they use in a given period of
time rather than paying for hardware or software upfront. (Note that in a private cloud, this
measured service usually involves some form of chargebacks where IT keeps track of how many
resources different departments within an organization are using.)

6. On-demand self-service: This means that cloud customers can sign up for, pay for and start
using cloud resources very quickly on their own without help from a sales agent.

7. Broad network access: Customers access cloud services via the Internet.

8. Resource pooling: Many different customers (individuals, organizations or different


departments within an organization) all use the same servers, storage or other computing
resources.

9. Rapid elasticity or expansion: Cloud customers can easily scale their use of resources up or
down as their needs change.

10. Measured service: Customers pay for the amount of resources they use in a given period of
time rather than paying for hardware or software upfront. (Note that in a private cloud, this
measured service usually involves some form of chargebacks where IT keeps track of how many
resources different departments within an organization are using.)

Classifications of Cloud Model:

Cloud computing can be divided into several sub-categories depending on the physical location of
the computing resources and who can access those resources.

Public cloud vendors offer their computing services to anyone in the general public. They
maintain large data centers full of computing hardware, and their customers share access to that
hardware.

By contrast, a private cloud is a cloud environment set aside for the exclusive use of one
organization. Some large enterprises choose to keep some data and applications in a private cloud
for security reasons, and some are required to use private clouds in order to comply with various
regulations.
Organizations have two different options for the location of a private cloud: they can set up a
private cloud in their own data centers or they can use a hosted private cloud service. With a
hosted private cloud, a public cloud vendor agrees to set aside certain computing resources and
allow only one customer to use those resources.

A hybrid cloud is a combination of both a public and private cloud with some level of integration
between the two. For example, in a practice called "cloud bursting" a company may run Web
servers in its own private cloud most of the time and use a public cloud service for additional
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

capacity during times of peak use.


A multi-cloud environment is similar to a hybrid cloud because the customer is using more than
one cloud service. However, a multi-cloud environment does not necessarily have integration
among the various cloud services, the way a hybrid cloud does. A multi-cloud environment can
include only public clouds, only private clouds or a combination of both public and private clouds.

Common Cloud Service Models:

Cloud services are typically deployed based on the end-user (business) requirements. The primary
services include the following:

1. Software as a Service (SaaS)


SaaS is a software delivery method that provides access to software and its functions
remotely as a Web-based service. Instead of paying an upfront fee to purchase and/or
license software, SaaS customers pay a recurring (often monthly or annual) fee to subscribe
to the service. In general, they can access the SaaS from any Internet-connected device,
any time day or night. Well-known examples of SaaS include Salesforce.com, Microsoft
Office 365, Google G Suite, Dropbox, Adobe Creative Cloud and others.

2. Platform as a Service (PaaS)


PaaS is a computing platform being delivered as a service. Here the platform is outsourced in
place of a company or data center purchasing and managing its own hardware and software layers.
Most PaaSes are designed for developers and aim to simplify the process of creating and
deploying software. For example, a Web developer might use a PaaS that includes operating
system software, Web server software, a database and related Web development tools. The leading
PaaS vendors include Amazon Web Services, Microsoft Azure, IBM and Google Cloud Platform.

3. Infrastructure as a Service (IaaS)


Computer infrastructure, such as servers, storage and networking delivered as a service. IaaS is
popular with enterprises that appreciate the convenience of having the cloud vendor manage their
IT infrastructure. They also sometimes see cost savings as a result of paying only for the
computing resources they use. The leading IaaS vendors include Amazon Web Services, Microsoft
Azure, IBM and Google Cloud Platform. While SaaS, PaaS and IaaS are the three most common
types of cloud services, cloud computing vendors sometimes also use other "as a service" labels to
describe their offerings. For example, some offer database as a service (DBaaS), mobile back-end
as a service (MBaaS), functions as a service (FaaS) or others.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Benefits of Cloud Computing:


Consumers and organizations have many different reasons for choosing to use cloud computing
services. They might include the following:
 Convenience
 Scalability
 Low costs
 Security
 Anytime, anywhere access
 High availability

Examples of Cloud Computing Services:

 Amazon EC2 — Virtual IT.


 Google App Engine — Application hosting.
 Google Apps and Microsoft Office Online — SaaS.
 Apple iCloud — Network storage.
 DigitalOcean — Servers (Iaas/PaaS)
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website :www.mvjce.edu.in
Accredited by NBA & NAAC

Prof.Santhiya M, HOD, Dept. of CSE Email:[email protected]

TOPIC: INTERNET OF THINGS (IOT)

Definition:

The internet of things, or IoT, is a system of interrelated computing devices, mechanical and
digital machines, objects, animals or people that are provided with unique identifiers (UIDs)
and the ability to transfer data over a network without requiring human-to-human or human-
to-computer interaction.

The internet of things is also a natural extension of SCADA (supervisory control and data
acquisition), a category of software application program for process control, the gathering of
data in real time from remote locations to control equipment and conditions. SCADA systems
include hardware and software components. The hardware gathers and feeds data into a
computer that has SCADA software installed, where it is then processed and presented it in a
timely manner. The evolution of SCADA is such that late-generation SCADA systems
developed into first-generation IoT systems.

Diagram Showing main Components:


An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

How IoT works:

An IoT ecosystem consists of web-enabled smart devices that use embedded processors,
sensors and communication hardware to collect, send and act on data they acquire from their
environments. IoT devices share the sensor data they collect by connecting to an IoT gateway
or other edge device where data is either sent to the cloud to be analyzed or analyzed locally.
Sometimes, these devices communicate with other related devices and act on the information
they get from one another. The devices do most of the work without human intervention,
although people can interact with the devices for instance, to set them up, give them
instructions or access the data.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Why IoT is important:

The internet of things helps people live and work smarter as well as gain complete control
over their lives. In addition to offering smart devices to automate homes, IoT is essential to
business. IoT provides businesses with a real-time look into how their companies’ systems
really work, delivering insights into everything from the performance of machines to supply
chain and logistics operations.

IoT enables companies to automate processes and reduce labor costs. It also cuts down on
waste and improves service delivery, making it less expensive to manufacture and deliver
goods as well as offering transparency into customer transactions.

IoT touches every industry, including healthcare, finance, retail and manufacturing. Smart
cities help citizens reduce waste and energy consumption and connected sensors are even
used in farming to help monitor crop and cattle yields and predict growth patterns.

As such, IoT is one of the most important technologies of everyday life and it will continue to
pick up steam as more businesses realize the potential of connected devices to keep them
competitive.

Applications of IoT:

There are numerous real-world applications of the internet of things, ranging from consumer
IoT and enterprise IoT to manufacturing and industrial IoT .IoT applications span numerous
verticals, including automotive, telecom and energy.

In the consumer segment, for example, smart homes that are equipped with smart
thermostats, smart appliances and connected heating, lighting and electronic devices can be
controlled remotely via computers and smartphones.

Wearable devices with sensors and software can collect and analyze user data, sending
messages to other technologies about the users with the aim of making users' lives easier and
more comfortable. Wearable devices are also used for public safety for example, improving
first responders' response times during emergencies by providing optimized routes to a
location or by tracking construction workers' or firefighters' vital signs at life-threatening
sites.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

In healthcare, IoT offers many benefits, including the ability to monitor patients more closely
to use the data that's generated and analyze it. Hospitals often use IoT systems to complete
tasks such as inventory management, for both pharmaceuticals and medical instruments.

Smart buildings can, for instance, reduce energy costs using sensors that detect how many
occupants are in a room. The temperature can adjust automatically for example, turning the
air conditioner on if sensors detect a conference room is full or turning the heat down if
everyone in the office has gone home.

TOPIC: DATA SCIENCE

Definition: Data science is a multi-disciplinary field that uses scientific methods, processes,
algorithms and systems to extract knowledge and insights from structured and unstructured data.
Data science is the same concept as data mining and big data use the most powerful hardware, the
most powerful programming systems, and the most efficient algorithms to solve problems

Requirements of data science:


Data science is a blend of skills in three major areas,

Mathematics Expertise: Solutions to many business problems involve building analytic models
grounded in the hard math, where being able to understand the underlying mechanics of those
models is key to success in building them. Many inferential techniques and machine learning
algorithms lean on knowledge of linear algebra.

Technology and Hacking: Data scientists utilize technology in order to wrangle enormous data
sets and work with complex algorithms, and it requires tools far more sophisticated than Excel.
Data scientists need to be able to code — prototype quick solutions, as well as integrate with
complex data systems. Core languages associated with data science include SQL, Python, R, and
SAS.

Strong Business Acumen: It is important for a data scientist to be a tactical business consultant.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Working so closely with data, data scientists are positioned to learn from data in ways no one else
can. That creates the responsibility to translate observations to shared knowledge, and contribute to
strategy on how to solve core business problems.

Lifecycle of Data Science

Phase 1—Discovery: Before you begin the project, it is important to understand the various
specifications, requirements, priorities and required budget. You must possess the ability to ask the
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

right questions. if you have the required resources present in terms of people, technology, time and
data to support the project.
Phase 2—Data preparation: In this phase, you require analytical sandbox in which you can
perform analytics for the entire duration of the project. You need to explore, preprocess and
condition data prior to modeling. Further, you will perform ETLT (extract, transform, load and
transform) to get data into the sandbox. You can use R for data cleaning, transformation, and
visualization.
Phase 3—Model planning: Here, you will determine the methods and techniques to draw the
relationships between variables. These relationships will set the base for the algorithms which you
will implement in the next phase. You will apply Exploratory Data Analytics (EDA) using various
statistical formulas and visualization tools.
Phase 4—Model building: In this phase, you will develop datasets for training and testing
purposes.
Phase 5—Operationalize: In this phase, you deliver final reports, briefings, code and technical
documents.
Phase 6—Communicate results: Now it is important to evaluate if you have been able to achieve
your goal that you had planned in the first phase. So, in the last phase, you identify all the key
findings, communicate to the stakeholders and determine if the results of the project are a success
or a failure based on the criteria developed in Phase 1.
Applications:
1. Fraud and Risk Detection
The earliest applications of data science were in Finance. Companies were fed up of bad debts and
losses every year. However, they had a lot of data which use to get collected during the initial
paperwork while sanctioning loans. They decided to bring in data scientists in order to rescue them
out of losses.
2. Medical Image Analysis
Procedures such as detecting tumors, artery stenosis, and organ delineation employ various different
methods and frameworks like Map Reduce to find optimal parameters for tasks like lung texture
classification. It applies machine learning methods, support vector machines (SVM), content-based
medical image indexing, and wavelet analysis for solid texture classification.
3. Internet Search
All these search engines (including Google) make use of data science algorithms to deliver the best
result for our searched query in a fraction of seconds

TOPIC: WIRELESS SENSOR NETWORK (WSN)

Definition
Wireless sensor network (WSN) refers to a group of spatially dispersed and dedicated
sensors for monitoring and recording the physical conditions of the environment and organizing the
collected data at a central location. WSNs measure environmental conditions like temperature,
sound, pollution levels, humidity, wind, and so on.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Diagram showing main components

The WSN is built of "nodes" – from a few to several hundreds or even thousands, where each node
is connected to one (or sometimes several) sensors. Each such sensor network node has typically
several parts: a radio transceiver with an internal antenna or connection to an external antenna,
a microcontroller, an electronic circuit for interfacing with the sensors and an energy source,
usually a battery or an embedded form of energy harvesting. A sensor node might vary in size from
that of a shoebox down to the size of a grain of dust. The cost of sensor nodes is similarly variable,
ranging from a few to hundreds of dollars, depending on the complexity of the individual sensor
nodes. Size and cost constraints on sensor nodes result in corresponding constraints on resources
such as energy, memory, computational speed and communications bandwidth. The topology of the
WSNs can vary from a simple star network to an advanced multi-hop wireless mesh network. The
propagation technique between the hops of the network can be routing or flooding.

Description/Working

Requirements for Implementation

Hardware: Basic hardware components are nodes which form network. Nodes are of varying size
and cost depending on the type of sensors. In many applications, a WSN communicates with
a Local Area Network or Wide Area Network through a gateway. The Gateway acts as a bridge
between the WSN and the other network. This enables data to be stored and processed by devices
with more resources, for example, in a remotely located server. A wireless wide area network used
primarily for low-power devices is known as a Low-Power Wide-Area Network (LPWAN).

Wireless Communication Standards: There are several wireless standards and solutions for
sensor node connectivity. Thread and ZigBee can connect sensors operating at 2.4 GHz with a data
rate of 250kbit/s. Many use a lower frequency to increase radio range (typically 1 km), for
example Z-wave operates at 915 MHz and in the EU 868 MHz has been widely used but these have
a lower data rate. With the emergence of Internet of Things, many other proposals have been made
to provide sensor connectivity. LORA is a form of LPWAN which provides long range low power
wireless connectivity for devices, which has been used in smart meters. Wi-SUN connects devices
at home.

Software: Major software component is Operating systems for wireless sensor network nodes.
They are typically less complex than general-purpose operating systems. They more strongly
resemble embedded systems, for two reasons. First, wireless sensor networks are typically deployed
with a particular application in mind, rather than as a general platform. Second, a need for low costs
and low power leads most wireless sensor nodes to have low-power microcontrollers ensuring that
mechanisms such as virtual memory are either unnecessary or too expensive to implement.
Any algorithms or protocols implemented should aim for Lifetime maximization. Energy/Power
Consumption of the sensing device should be minimized and sensor nodes should be energy
efficient since their limited energy resource determines their lifetime. To conserve power, wireless
sensor nodes normally power off both the radio transmitter and the radio receiver when not in use.
An Autonomous Institute
NEAR ITPB, CHANNASANDRA, BENGALURU – 560 067

Affiliated to VTU, Belagavi Ph: 080-4299-1000


Approved by AICTE, New Delhi Fax: 080-28452443
Recognized by UGC under 2(f) & 12(B) Website : www.mvjce.edu.in
Accredited by NBA & NAAC

Applications

Area monitoring
Area monitoring is a common application of WSNs. In area monitoring, the WSN is deployed over
a region where some phenomenon is to be monitored. A military example is the use of sensors to
detect enemy intrusion; a civilian example is the geo-fencing of gas or oil pipelines.
Health care monitoring
There are several types of sensor networks for medical applications: implanted, wearable, and
environment-embedded. Implantable medical devices are those that are inserted inside the human
body. Wearable devices are used on the body surface of a human or just at close proximity of the
user. Environment-embedded systems employ sensors contained in the environment. Possible
applications include body position measurement, location of persons, overall monitoring of ill
patients in hospitals and at home.
Environmental/Earth sensing
There are many applications in monitoring environmental parameters, like Air pollution
monitoring, Forest fire detection, Water quality monitoring.

You might also like