0% found this document useful (0 votes)
20 views6 pages

DMS I Test 2023

Uploaded by

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

DMS I Test 2023

Uploaded by

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

Bapuji Educational Association (Regd.

)
Bapuji Institute of Engineering and Technology, Davangere–577 004
Department of Master of Computer Applications
Mathematical Foundation for
Course Title Course Code 22MCA11
Computer Applications
Course
Roopa R Semester I
Coordinator
CIE No. 1st Max. Marks 20
9.00 am to
Date: 20-03-2023 Time
10.00am

Course Outcome Statements:


CO1 To introduce the concepts of mathematical logic.
CO2 To introduce the concepts of sets, relations and functions.
CO3 To perform the operations associated with sets, functions and relations.
CO4 To relate practical examples of the appropriate set, functions or relation m and interpret
the associated operations and terminology in context.
CO5 Design strategy using gaming theory concepts for the given problem.

Note : Answer any two full questions from each part.


Q. Marks RBT
Question CO
No. Level
Part A
a. 4 L1 CO1
1
b 6 L2 CO1
OR
a 4 L2 CO1
2
b. 6 L2 CO2
Part B
a. Find the domain, range, relational matrix 4 L2 CO3
3 R = {(a,1),(a,2),(b,1),(c,2),(d,1),(d,4),(c,4)}
c. Let A= { 1,2,3,4} and R= { (1,2),(2,2),(3,4)(4,1)} is R 6 L3 CO3
(a) Reflexive (b) Symmetric (c) Antisymmetric, (d)Transistive?
OR
a. Prove that a)AX(BUC)=(AXB)U(AXC) 6 L2 CO3
b)AX(B-C)=(AXB) - (AXC)
b. Let A= {1,2,3,4} and let R be the relation on A defined y xRy if 4 L2 CO3
X4 and only if “x divides y” written x|y.
a) Write down R as a set of Ordered pair.
b) Draw the digraph of R.

RBT (Revised Bloom’s Taxonomy) Levels : Cognitive Domain


L1 : Remembering L2 : Understanding L3 : Applying
L4 : Analysing L5 : Evaluating L6 : Creating
Course Coordinator Coordinator Program Coordinator
Geetha M,Roopa R DQAC HOD, MCA

Bapuji Educational Association (Regd.)


Bapuji Institute of Engineering and Technology, Davangere–577 004
Department of Master of Computer Applications
Course Title Data Analytics Using Python CIE No. I
Semester 3rd Date: 05-01-2023
Course
Geetha M Max. Marks 20
Coordinator
Scheme of Evaluation
Note: Answer any two full questions from each part.
Q. Marks Total
Solution
No. Marks
Part A
1 a)Define Identifiers, expressions, variables, keyword and type 1 4
function with example.
Identifier is a name given to a program element.
Q. Marks Total
Solution
No. Marks
Part A
Ex: Variable names, class names and function names
Expression Arithmetic operations in python can be performed by using
arithmetic operators and some of the in-built functions. Ex: a = 2 1
b = 3 c = a + b print (c)
Variables need not be declared first in python. They can be used
directly. Variables in python are case-sensitive as most of the other
programming languages. Ex: a = 3 print (a)
Keywords are special words which cannot be used as identifiers. 1
Ex: for, if, del, def etc.
Type function () function is used to get the type of an object. When a
single argument is passed to the type () function, it returns the type of the 1
object.

b) Discuss different forms of if-else statements with examples.


if condition:
#statement to execute if the condition is true
if(condition):
#Executes this block if the condition is true
else:
#Executes this block if the condition is false 3
Nested IF Statement
When an if a statement is present inside another if statement, it is called a
nested IF statement. This situation occurs when you have to filter a vari-
able multiple times. 6
Syntax:
if (condition1):
#Executes if condition1 is true
if (condition2): 3
#Executes if condition2 is true
#Condition2 ends here
#Condition1 ends here

OR
2 a) Explain in detail loop control statements while and while with else
break and continue.
The while Loop
With the while loop we can execute a set of statements as long as a con- 2
dition is true.
i=1
while i< 6:
print(i)
i += 1 4
While with else clause will be executed if control comes out of the loop
because of the loop condition evaluating to False.
 Continue is used to skip the part of the loop. This statement exe-
2
Q. Marks Total
Solution
No. Marks
Part A
cutes the loop to continue the next iteration.
 In python, the break and continue statements are jump state-
ments. The break statement is used to terminate the loop while in
the case of the continue statement it is used to continue the next
iterative in the loop.
b) Explain for loop, break and continue statements with syntax and
examples.
Python For Loop is used for iterating over a sequence (that is either a
list, a tuple, a dictionary, a set, or a string).
This is less like the for keyword in other programming languages, and
works more like an iterator method as found in other object-orientated
programming languages.
With the for loop we can execute a set of statements, once for each item
in a list, tuple, set etc.
Example 3
Print each fruit in a fruit list:
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x) 6
The break Statement
With the break statement we can stop the loop even if the while condition
is true:
Example 3
Exit the loop when i is 3:
i=1
while i < 6:
print(i)
if i == 3:
break
i += 1
The continue Statement
With the continue statement we can stop the current iteration, and con-
tinue with the next:
Example
Continue to the next iteration if i is 3:
i=0
while i < 6:
i += 1
if i == 3:
continue
print(i)
Part B
3 a) Define Function. Explain both built in and user defined functions with 4
examples.
A function is a block of code which only runs when it is called. 2
You can pass data, known as parameters, into a function.
A function can return data as a result.
Q. Marks Total
Solution
No. Marks
Part A
Built in Function already defined in compiler.
Ex: abs(),bool()
Creating a Function
In Python a function is defined using the def keyword:
Ex: def my_function():
print("Hello from a function") 2

Calling a Function
To call a function, use the function name followed by parenthesis:
Ex: def my_function():
print("Hello from a function")
my_function()
b.Discuss scope and lifetime of a variable, *args and **kwargs with
example.
Scope and Lifetime of a variable:
Arbitrary Arguments, *args
If you do not know how many arguments that will be passed into your 3
function, add a * before the parameter name in the function definition.
This way the function will receive a tuple of arguments, and can access
the items accordingly:
If the number of arguments is unknown, add a * before the parameter
name:
def my_function(*kids):
print("The youngest child is "+ kids[2]) 6

my_function("Emil", "Tobias", "Linus")


Arbitrary Keyword Arguments, **kwargs 3
If you do not know how many keyword arguments that will be passed
into your function, add two asterisk: ** before the parameter name in the
function definition.
This way the function will receive a dictionary of arguments, and can ac-
cess the items accordingly:
If the number of keyword arguments is unknown, add a double ** before
the parameter name:
def my_function(**kid):
print("His last name is " + kid["lname"])
my_function(fname = "Tobias", lname = "Refsnes")
OR
4 a) Discuss the following: i)Keyword Arguments, ii)Default
Parameters iii) Command Line Arguments.
Keyword Arguments Usually, at the time of the function call, values get 2
assigned to the arguments according to their position.
Default Parameters Default values indicate that the function argument 6
will take that value if no argument value is passed during the function 2
call. The default value is assigned by using the assignment(=) operator
of the form keywordname=value.
Command Line Arguments he arguments that are given after the name
2
Q. Marks Total
Solution
No. Marks
Part A
of the program in the command line shell of the operating system are
known as Command Line Arguments.
b) Define String with example. Discuss basic string operations and
string slicing, joining with necessary programs.
Strings arrays of bytes representing unicode characters. However, 2
Python does not have a character data type, a single character is simply a 4
string with a length of 1.
Length,Concatenation, Slicing,Splitting 2

Course Coordinator Coordinator Program Coordinator


DQAC HOD, MCA

You might also like