You are on page 1of 3

P.V.

P Siddhartha Institute of Technology (Autonomous)


FREE OPEN SOURCE SOFTWARE Lab
Week 1: 8/7/2016
1. Write a program to display a string in python.
2. Write a program for arithmetic operations.
3. Write a program for relational operators.
4. Write a program for factorial of a given number.
5. Write a program to findout even or odd.
Week 2: 15/7/2016
1. Write a program that estimates the temperature in a freezer given the ellapsed
time in hours since a power failure. Assume this temp T is given by T=(4*t*t)/
(t+2)-20 where t is the time since the power failure. Your program should
prompt the user to enter how long it has been since the start of the power
failure in whole hours minutes in python.
2. Write a program to convert a temperature in degrees Fahrenhei to celcius
C=(F-32)*(5/9)
3. Write a program to read 2 numbers and menu driven program to provide
arithmetic operations.

Week 3: 15/7/2016
1. Write a program to compute and print water bill given an unpaid balance and
previous and current meter reading. Bill includes a demand charge of rs
35.00, a consumption charge of rs 1.10 per every 1000 liters used. Calculate
from meter reading taken recently and at the end of previous month. If the
costumers unpaid balance is greater than zero then rs 10.00 a late charges
is accessed as well.
2. Write a program implementing nested if statements if statement for the
following flow chart.
false

ph>7

true

ph=7
false

ph<12

true

false
neutral

ph>2
false

true

true
alkaline

very alkaline

P.V.P Siddhartha Institute of Technology (Autonomous)


FREE OPEN SOURCE SOFTWARE Lab
very acidic

acidic

3. Write a program that will calculate and print bills for city Power Company. The
rates vary depending on whether the use in residential, commercial or industrial.
A code R, means Residential use. Any other code should be treated as errors
other than C for commercial use and I for industrial use. The rates are computed
as follows:
a. R:

rs 6.00 plus 0.052 per known used

b. C:

rs 60.00 for first 1000 kwh and rs 0.045 for each additional kwh

c. I:

Rate varies depending on time of usage


i. peak hours: rs 76.00 for first 1000 kwh and rs 0.065 for each
additional kwh
ii. off peak hours: rs 40.00 for first 1000 kwh and rs 0.028 for each
additional kwh

4. Sort the given elements in a list using bubble sort.


5. Implement binary search.
6. Concatenate 2 lists without and with using built in functions.
Week 4: 8/8/2016
1. Write a program to demonstrate comments input and output in perl
2. Write a program that defines scalar data units
3. Write a program to demonstrate scalar data, array and hash data type.
4. Write a program perform all the array operations.
5. Write a program to convert strings to arrays and arrays to strings.
Week 5: 26/8/2016
1. Write a program to implement the following
Three Fuzzy Sets are defined as follows
={
B={
C={
Find

0.1/ 30 + 0.2/60 + 0.3/90 + 0.4/120 }


1/1
+ 0.2/2
+ 0.5/3
+ 0.7/4 + 0.3/5 + 0/6 }
0.33/100 + 0.65/200 + 0.92/300 + 0.21/400 }
(a) R = A x B
(b) S = B x C
(c) J = RoS

P.V.P Siddhartha Institute of Technology (Autonomous)


FREE OPEN SOURCE SOFTWARE Lab
2. Write a program to implement Fuzzy Inference for the below problem

Let H = High, VH = Very High, S = Slow, Q = Quite Slow indicate the associated
fuzzy sets as follows
For X = { 30, 40, 50, 60, 70, 80, 90, 100 }, the set of temperatures
Y = { 10, 20, 30, 40, 50, 60 }, the set of rotations per minute
H = { ( 70, 1 ) ( 80, 1 ) ( 90, 0.3 ) }
VH = { ( 90, 0.9 ) ( 100, 1 ) }
S = { ( 10, 1 ) ( 20, 0.8 ) }
QS = { ( 30, 0.8 ) ( 40, 1 ) ( 50, 0.6 ) }
Apply the Fuzzy Modus Ponens rule to deduce rotation is quite slow
i. If the Temparature is high, then rotation is slow.
ii. The Temparature is very high.

You might also like