Sunday, 7 June 2020

210247: Data Structures Laboratory Group A: Assignment No:01 Set Operation using pyhton List.


Guidelines for Laboratory Conduction 

The instructor is expected to frame the assignments by understanding the prerequisites, technological aspects, utility and recent trends related to the topic. The assignment framing policy need to address the average students and inclusive of an element to attract and promote the intelligent students. The instructor may set multiple sets of assignments and distribute among batches of students. It is appreciated if the assignments are based on real world problems/applications.

Encourage students for appropriate use of Hungarian notation, proper indentation and comments. Use of open source software is to be encouraged. In addition to these, instructor may assign one real life application in the form of a mini-project based on the concepts learned. Instructor may also set one assignment or mini-project that is suitable to respective branch beyond the scope of syllabus.

Set of suggested assignment list is provided in groups- A, B, C, D, and E. Each student must perform at least 13 assignments as at least 3 from group A, 3 from group B, 2 from group C, 2 from group D and 3 from group E. Group A and B assignments should be implemented in python without using built-in methods for major functionality of assignment. Use List data structure of Python as array. Group C, D and E assignments should be implemented in C++ language.

Operating System recommended:- 64-bit Open source Linux or its derivative Programming tools recommended: - Open Source python, Programming tool like Jupyter Notebook, Pycharm, Spyder, G++/GCC,

Examination Scheme:                                   Teaching Scheme: PR: 04 Hours/Week
TW: 25 Marks                                                   Credit 02
PR: 50 Marks


Hardware Requirement:
      Processor: Intel(R) Core(TM)2 Duo CPU  E7500 @ 2.93GHz
      Memory: 2.00 GB
      Operating System: 64-bit Open source

Software Requirement:
     Programming tool like PyCharm with Python 3.X.X Interpreter


Problem Statement:  

In second year computer engineering class, group A student’s play cricket, group B students play badminton and group C students play football. Write a Python program using functions to compute following: - 

a) List of students who play both cricket and badminton 

b) List of students who play either cricket or badminton but not both 

c) Number of students who play neither cricket nor badminton 

d) Number of students who play cricket and football but not badminton. 

(Note- While realizing the group, duplicate entries should be avoided, Do not use SET built-in functions) 

 

 Source Program:   

 




Output:       

Total Students in SE A Class: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Total Students in GoupA plays Cricket: [2, 4, 6, 8]
Total Students in GoupB plays Badminton: [3, 5, 6, 8]
Total Students in GoupC plays football: [1, 7]
>>> mainMenu()
1. List of students who play both cricket and badminton
2. List of students who play either cricket or badminton but not both
3. Number of students who play neither cricket nor badminton
4. Number of students who play cricket and football but not badminton.
5. Exit
Enter your choice:1
List of Stud Who Play both Cricket & Badminton are: [6, 8]
************************ !!!!!!!!!!!!!! ***************************
 
1. List of students who play both cricket and badminton
2. List of students who play either cricket or badminton but not both
3. Number of students who play neither cricket nor badminton
4. Number of students who play cricket and football but not badminton.
5. Exit
Enter your choice:2
The Stud Who Play only Cricket are: [2, 4]
The Stud Who Play only Badminton are: [3, 5]
************************ !!!!!!!!!!!!!! ***************************
 
1. List of students who play both cricket and badminton
2. List of students who play either cricket or badminton but not both
3. Number of students who play neither cricket nor badminton
4. Number of students who play cricket and football but not badminton.
5. Exit
Enter your choice:3
The Student who plays both Cricket and Badminton: [2, 4, 6, 8, 3, 5]
The Stud Who Play neither Cricket nor Badminton are: [1, 7, 9, 10]
************************ !!!!!!!!!!!!!! ***************************
 
1. List of students who play both cricket and badminton
2. List of students who play either cricket or badminton but not both
3. Number of students who play neither cricket nor badminton
4. Number of students who play cricket and football but not badminton.
5. Exit
Enter your choice:4
The Student who plays both Cricket and Football: [2, 4, 6, 8, 1, 7]
The Student who plays both Cricket and Football not badminton: [2, 4, 1, 7]
************************ !!!!!!!!!!!!!! ***************************
 
1. List of students who play both cricket and badminton
2. List of students who play either cricket or badminton but not both
3. Number of students who play neither cricket nor badminton
4. Number of students who play cricket and football but not badminton.
5. Exit
Enter your choice:5
>>>  

data structures and algorithms Web Developer

No comments:

Post a Comment