Copy and paste the below link in a separate window for Software Engineering & Project Management(21CS61) Complete Notes and Question Bank
https://drive.google.com/drive/u/0/folders/1wmdWysf6D_1jXoJ2_ALs8RWxIH5a2lAn
Copy and paste the below link in a separate window for Software Engineering & Project Management(21CS61) Complete Notes and Question Bank
https://drive.google.com/drive/u/0/folders/1wmdWysf6D_1jXoJ2_ALs8RWxIH5a2lAn
BDA_MODULE1_PPTs
Follow below link
https://docs.google.com/presentation/d/1VAiyi8CwqhcxJgNi10zqTm2ytv3Sz9YV/edit?usp=sharing&ouid=117785189492851473372&rtpof=true&sd=true
Big Data Analytics (18CS72) MODULE-1
Follow Below Link
https://docs.google.com/document/d/1QKGVs9ketbOBGwQKLLEyi4PNcbUee07O/edit?rtpof=true
CLICK ON THE BELOW LINK TO GET FULL NOTES, ASSIGNMENT QUESTIONS,PPTs AND MODEL QUESTION PAPRES OF CG&V
https://drive.google.com/drive/folders/1Uz_D3a0ZkVGfsvbNN6Jrm1qkg4m7j00o
Application
Development Using Python (18CS55)
Module 1
Application
Development Using Python (18CS55)
Module 1
1)
Find
the out put of following expressions
1) (5 - 1) * ((7 + 1) /(3 – 1))
2)'Alice'*5
3) -9 % 5
4)11//3
5)2 ** 8
6) spam * 4
7)15/2.0
8)'Alice'+42
2) Develop a Python program to find the
average of best two marks out of three marks taken as input. Use Exceptional
Handling if the input is not a number.
3) What
is the difference between range(10),range(0,10),and range(0, 10,1) in a for
loop?
4) Explain
the rules of precedence used by python to evaluate an expression?
5) Write a
short program that prints the numbers 1 to 10 using a for loop by using all the above ranges.
6) WAP to
find best of two test averages form the three tests.
7) List the
rules to declare variables? Explain 3 ways of declaring variables with an
example?
8) Distinguish
between break and continue statements with an example.
9)
Demonstrate with an example Print(), Input() and string replication.
10) Explain
elif , for, while, beak and continue statements in python with an example for
each.
11) Write a
python program to check whether a given no. is even or odd.
12) How can
we pass parameters in user defined functions explain with an example.
13) Explain
local and global scope with local and global variables.
14)
Demonstrate the concept of exception.
Implement a code which prompts
the user for Celsius temp , convert the temp to farenheat and print out the
converted temp by handling exceptions.
15) Explain
the types of errors with examples.
16) Write a
python program using try and except ,so that your program handles non numeric
input gracefully by printing the message and existing the program the following
shown to execution of the program
Enter
hours:20
Enter Rate:9
Error:
please enter numeric input
Enter hours:
forty
Error,
please enter numeric input
17) Explain
conditional execution ,alternative execution chained conditionals and nested
conditional with examples.
18) Explain
break and continue statement with examples in python.
19)
Write a program with a function computer
grade that takes score as its parameter and returns a grade as a string.
20) Write a
python program to find greatest of three numbers (without using and operator)
by getting three numbers through keyboard using functions.
21) WAP that
uses input to prompt a user for their name and than welcomes them.
22) Explain
str(),int(),float() functions with example.?
23) Explain
elif with an example program.?
24) WAP that
ask for a user name and password using continue statement.?
25) Discuss
the starting, stopping and stepping arguments to range() in python.
26) Discuss
Importing modules in detail.
27) Explain
def,none and return values and return statements in python.
28) Discuss
local and global scope .
29)WAP to
guess the number between 1 and 20 in python.
Click on the below link
https://docs.google.com/document/d/10vkWpG8eGaFIyu5rIau0LI9RfBRyF4Wn/edit?usp=sharing&ouid=117785189492851473372&rtpof=true&sd=true
class Thread { public: Thread(char* debugName); ~Thread(); void Fork(void (*func)(int), int arg); void Yield(); void Finish(); }
Thread
constructor creates a new thread. It allocates a data structure with space for the TCB.Fork
method gives it the function and a parameter to the function.Fork
do? It first allocates a stack for the thread. It then sets up the TCB so that when the thread starts running, it will invoke the function and pass it the correct parameter. It then puts the thread on a run queue someplace. Fork
then returns, and the thread that called Fork
continues.int a = 0; void sum(int p) { a++; printf("%d : a = %d\n", p, a); } void main() { Thread *t = new Thread("child"); t->Fork(sum, 1); sum(0); }
sum
run concurrently. What are the possible results of the program? To understand this fully, we must break the sum
subroutine up into its primitive components.sum
first reads the value of a
into a register. It then increments the register, then stores the contents of the register back into a
. It then reads the values of of the control string, p
and a
into the registers that it uses to pass arguments to the printf
routine. It then calls printf
, which prints out the data.la a, %r0 ld [%r0],%r1 add %r1,1,%r1 st %r1,[%r0] ld [%r0], %o3 ! parameters are passed starting with %o0 mov %o0, %o1 la .L17, %o0 call printf
0 : 1 0 : 1 1 : 2 1 : 1 1 : 2 1 : 1 0 : 1 0 : 1 1 : 1 0 : 2 0 : 2 1 : 2 0 : 2 1 : 2 1 : 1 0 : 2So the results are nondeterministic - you may get different results when you run the program more than once. So, it can be very difficult to reproduce bugs. Nondeterministic execution is one of the things that makes writing parallel programs much more difficult than writing serial programs.
a
to be 2 after both threads finish. To achieve this, must make the increment operation atomic. That is, must prevent the interleaving of the instructions in a way that would interfere with the additions.class Semaphore { public: Semaphore(char* debugName, int initialValue); ~Semaphore(); void P(); void V(); }
sum
example work:int a = 0; Semaphore *s; void sum(int p) { int t; s->P(); a++; t = a; s->V(); printf("%d : a = %d\n", p, t); } void main() { Thread *t = new Thread("child"); s = new Semaphore("s", 1); t->Fork(sum, 1); sum(0); }
a
. Use mutual exclusion to make operations atomic. The code that performs the atomic operation is called a critical section.Semaphore *s; void consumer(int dummy) { while (1) { s->P(); consume the next unit of data } } void producer(int dummy) { while (1) { produce the next unit of data s->V(); } } void main() { s = new Semaphore("s", 0); Thread *t = new Thread("consumer"); t->Fork(consumer, 1); t = new Thread("producer"); t->Fork(producer, 1); }In some sense the semaphore is an abstraction of the collection of data.