Professional Documents
Culture Documents
Final - BCSE101E - Cyclesheet (PhaseI I)
Final - BCSE101E - Cyclesheet (PhaseI I)
Python
1. Computer Programming: Python has two Course Outcomes [CO] which are
mentioned in each question as [CO1] or [CO2]
2. Level of the questions is defined based on Bloom’s taxonomy ([L1], [L2], [L3],
[L4], [L5] and [L6]). It is a hierarchical classification of the different levels of
thinking i.e., basic level to creating new solution level.
3. Students must practice cycle sheet programs in Moodle – Virtual Programming Lab
(VPL) to do the assessments.
To login for the first time in Moodle:
(Reset the password using Registration number or VIT email id)
BCSE101E - Computer Programming: Python
https://moovit.vit.ac.in/login/forgot_password.php
Login URL: https://moovit.vit.ac.in/
4. Malpractice in any form is not acceptable and it will be viewed seriously based on
academic guidelines. Students are advised to adhere to the due dates set for each
Assessment.
5. Programs given in Lab Cycle sheet can be used to attain basic knowledge. Cycle
sheet programs are only for practice. Students must explore and practice more
programs which will help to attempt the exams. Challenging problems / Higher order
Thinking [HoT] questions will be asked during Assessments.
1
Module 1 & 2
For example, if a housefly lived for 21 days, then its approximate age in seconds is
21*24*60*60 is 1814400.
[M12_CSQ2] Milk is collected for sales from nearest ‘n’ farms to the milk booth. Given the
amount of milk from ‘n’ farms in liters and ml. Write a PAC chart, algorithm, and flowchart
to compute total quantity of milk in the booth. [CO1] [L1]
2
[M12_CSQ3] Write a PAC Chart, algorithm, and flowchart for converting the given two-
digit number into its corresponding Roman numeral [CO1] [L1]
[M12_CSQ4] Write a PAC Chart, Algorithm and Python program to input two complex
numbers and add the same to produce the result. After producing the result, print the real
part and imaginary part separately. [CO1] [L1]
[M12_CSQ5] Write a PAC Chart, Algorithm and Python program to convert the given
integer to the corresponding binary, octal and hexadecimal values and print the same.
[CO1] [L1]
3
[M12_CSQ6] Write a PAC Chart, Algorithm and Python program to calculate the area of a
triangle, given its three sides a, b, and c. [CO1] [L1]
[M12_CSQ7] Write a PAC chart, algorithm, and Python program to convert string to
integer. [CO1] [L1]
[M12_CSQ8] Write a PAC chart, algorithm, and Python program to convert integer to
string. [CO1] [L1]
[M12_CSQ9] Write a PAC Chart, algorithm, and Python program to convert Fahrenheit to
Celsius by using lambda operator. Print the result with two decimal places only. [CO1][L1]
4
[M12_CSQ10] Write a PAC chart, algorithm, and Python program to swap the value of the
given two variables. [CO1][L1]
Module 3
[M3_CSQ1] Draw a flowchart and construct a python program to accept the monthly
income of an employee and display the income tax to be paid at the end of the year
according to the following criteria : [CO1] [L2]
> 1000000 4%
[M3_CSQ2] Draw a flowchart and construct a python program to A taxi driver charges the
bill as follows. On a fine day, Mr. Roy travels to his office by the taxi. Write a Python
program to accept the kilometers travelled by Mr. Roy and calculate his taxi bill. [CO1] [L2]
5
First 10 Km Rs15/km
Next 90 Km Rs 8/km
After that Rs6/km
[M3_CSQ3] Draw a flowchart and construct a python program to for the course BCSE101E,
bonus marks are awarded to the students according to their mark scored in the exam and
the class type. Write a python program to accept the marks, class type ‘T’ for theory or ‘L’
for lab. Display the final marks by adding the bonus mark to the original mark, based on
the given conditions. [Note: If the mark given by the user is 0 then display the message:
“Enter appropriate Mark”]. [CO1] [L2]
Bonus
Mark Class type
Mark %
>=80 T 8%
L 6%
>= 60 and <80 T 6%
L 4%
>=40 and <60 T 4%
6
given n is an even number. Same way the factorial of odd numbers between 1 and n if the
given n is an odd number. (use while loop) [CO1] [L2]
[M3_CSQ5] Draw a flowchart and construct a python program to calculate sum of digits of
a given number until the sum becomes a single digit number. (Using loop). [CO1] [L2]
Module 4
BCSE101E - Computer Programming: Python
7
Input:
6 // length of list
[4, 3, 100, 2, 3, 2] //actual list
Output:
2 (index of the chosen element) (Sum of elements at the left = Sum of elements at the
Right = 7)
Test Cases are
[M4_CSQ2] Draw a flowchart and construct a python program to Write a python program
using list to implement reverse polish notation calculator. In reverse polish notation,
mathematical expressions are written with the operator following its operands. For
example, 3 + 4 becomes 3 4 +. Order of operations is entirely based on the ordering of the
operators and operands. To write 3 + (4 ∗ 2), we would write 3 4 2 ∗ + in RPN. The
expressions are evaluated from left to right. Evaluate the expression and display the result.
[CO1] [L2]
8
[M4_CSQ3] Draw a flowchart and construct a python program to Write a Python program
to create and accept a two-dimensional list of M elements with different data types. Use
this list as a database to store two entries (rows) and retrieve the appropriate row by
assuming some field as primary key. [CO1] [L2]
Input:
2 //Number of lists
5 // length of list M
[“John”, “smith”, 1234, “B+”, 10.03] //actual list row1
[“Rockey”, “Jr”, 6789, “A+”, 40.03] //actual list row2
2 // index of the primary key
1234 //value of the primary key query
Output:
[“John”, “smith”, 1234, “B+”, 10.03]
9
[M4_CSQ4] Draw a flowchart and construct a python program which accepts the items of
tuples containing the category as the first entry and different components of the category
along with their costs as the following entries. The job is to create a tuple which
summarizes the costs for each category. [CO1] [L2]
Output:
((Education, 95), (Defense, 110))
Test Cases are
10
Airtel AirForce
100 40
Jio Navy
80 45
output=((Stationary, output=((Education,
90), (Communication, 95), (Defense, 110))
250), (Internet, 180))
[M4_CSQ5] Draw a flowchart and construct a python program to read the three subject’s
marks secured by n students during FAT examination. If a student secured less than 50 in
any subject, the student is failed in that subject. Count the number of students who failed
in each subject and the total number of students who failed in at least one subject. [CO1]
[L2]
Input:
Output:
11
54 50 40
3
M1 output= output=
77 M1 M1
M2 0 0
84 M2 M2
M4 0 2
51 M3 M3
1 1
output= M4 2
M1 1
0 M5
M2 0
2 2
M3
1
M4
0
2
Module 5
You have been given a String S consisting of uppercase and lowercase English alphabets.
You need to change the case of each alphabet in this String. That is, all the uppercase
letters should be converted to lowercase and all the lowercase letters should be converted
to uppercase. You need to then print the resultant String to output. [CO2] [L2]
Input Format
The first and only line of input contains the String S
Output Format
Print the resultant String on a single line.
12
Test Cases are
[M5_CSQ2] Construct an algorithm and write a python program for the problem given
below: [CO2] [L2]
A word is called as a good word if all the letters of the word are distinct. That is, all the
letters of the word are different from each other letter. Else, the word is called as a bad
word. Write an algorithm and the subsequent Python code to check if the given word is
good or bad.: e.g. START, GOOD, BETTER are bad: WRONG is good! Make the comparison
to be case insensitive.
[M5_CSQ3] Construct an algorithm and write a python program to search a literal, string
in a string and find the location within the original string where the pattern occurs. [CO2]
[L2]
BCSE101E - Computer Programming: Python
13
A word is called as a good word if all the letters of the word are distinct. That is, all the
letters of the word are different from each other letter. Else, the word is called as a bad
word. Write an algorithm and the subsequent Python code to check if the given word is
good or bad.: e.g. START, GOOD, BETTER are bad: WRONG is good! Make the comparison
to be case insensitive.
output= ['75', '55', '98'] output= ['95', '95', '98'] output=['75', '55', '98']
['Rahul', 'Vijay', 'Subbu'] ['Guru', 'sivaji', 'Rajini'] ['Mani', 'Poya', 'Suresh']
[M5_CSQ5] Construct an algorithm and write a python program python program to create
a regular expression to retrieve all words starting with vowels in each string. [CO2] [L2]
14