Daffodil International University
Department of Computer Science and Engineering
Faculty of Science & Information Technology
Midterm Exam Examination, Spring 2021 @ DIU Blended Learning Center Course Code: CSE233 (Day), Course Title: Object-Oriented Programming II
Level: 2; Term: 2; Section: All Instructor: ALL; Modality: Open Book Exam Date: Tues 9 March, 2021; Time: 09:00am-11:30am
Two and half hours (2:30) to support online open/case study based assessment Marks: 25
Directions:
● Students need to go through the CASE STUDY shown in this exam paper.
● Analyze and answer specific sections based on your own thinking and work.
● Do not share as this will be treated as plagiarism by Blended Learning Center.
#
Questions(Answer All)
Marks1
As you can see the following is a python code. Your tasks are to find out and explain the problem statement, output and algorithm/ pseudocode of the following code.[4]
2
Suppose you have a plan for travelling different countries in year 2022 with your friends. The country that you have listed are following: [‘India’, ‘Thailand’, ‘Bhutan’, ‘China’, ‘Nepal’,‘Myanmar’]. But one of your friends tells you that we cannot travel Myanmar due to the political unrest. Therefore, the country name will be removed from the list. Write a program to display the entire countries name except Myanmar using Loop in python program.
[3]
3
Suppose you have a list as following:Your ID:161-15-201 =3 integer
PHONE NUMBER: 01787552399 Spread like 017-875-52-399 = 4 integer
Now construct a list of 7 integers of your own ID and phone number and ask user to give a number. Then you can check the number that you have taken from user is present or not present in the list. Justify your answer line by line.
[4]
4
Write a program to create a function which will take five numbers from user and check every number which is divisible by 5 or 8 and also lies between 1 and 100. Shortly explain every step of your program.[4]
5
Suppose today's your birthday, and you want to throw a party for your 8 friends [for better understanding we will consider A, B, C, D, E, F, G, H as your friend’s name]. You call an Uber Micro that will pick you and your all friends from Daffodil City Campus. You intended to go for Handi Restaurant, but your friends want to go Bashundhara City first. You guys reach there and lift the micro, H pay the rent. In the shopping mall your friends give you a surprise and they buy you a shirt, shoes and jeans. A and B pay all the bill. Then you guys reach the Handi Restaurant through another Uber micro, this time you pay the rent. In the restaurant 5 of your friends ordered Hyderabadi biryani, 2 of your friends ordered tandoori chicken, 1 of them ordered tandoori chicken and mutton biryani, whereas you ordered chicken biryani. In soft drinks 3 takes lemon juice, 3 takes cold coffee and other 2 alone with you takes cold drinks. But you guys get 2 lemon juice, 1 cold coffee and 1 cold drink as complementary. At the end you pay the bill with credit cards and get 10% discount. In the return way you call a micro and reach Daffodil City Campus, and this time C pay the rent.a. Now prepare a python program to calculate all expenses individually (you and your friends). All the expenses of your friends should be divided equally among all of them.
Try to insert, update all expenses and individual cash deposit instantly. Finally display the followings:
Your total expense
Total expense of your friends.
Individual deposit of all your friends (IF any).
Total cash need to contribute by your friends individually.
Total cash need to give back to your friends individually (IF any).
Note: Assume all variable and values as you like, explain code in every block.
b. Express your overall thinking process in words to solve this real-life problem. Just mention how you conceptualized all the conditions. Try to keep it simple [no more than 10 lines]