Вы находитесь на странице: 1из 2

National University of Sciences & Technology

School of Electrical Engineering and Computer Science


Department of Computing

CS-114 - Fundamentals of Programming (2+1): BE(SE)-11A Fall 2020

Assignment 5
CLO: Apply computer programing to solve real-world problems
Maximum Marks: 10 Instructor: Dr. Arham Muslim
Announcement Date: 26.12.2020 Due Date: 2.1.2021 at 23:59 on LMS

Instructions:
In this assignment, you will use different programming concepts to perform the given task. You are only allowed to use
the concepts that you have learned so far. Any type of collection (list, tuple, set, dictionary) can be used in this
assignment unless a specific type is requested.

Note: You should use sensible and self-explanatory names for the variables. Add appropriate comments to explain your
code. Use print statements to show relevant messages. In case solutions of two or more students match, all will receive
zero irrespective of who generated the solution and who copied it.

Deliverables:
Rename the assignment file to A05-<Your Name>.docx. Submit your solution to LMS before the due date.

Tasks:
Write a modular program that allows you to manage a cricket tournament. You should show a menu to the user
from where he\she can perform al least the following tasks: (Marks:10)
 Get team details: ask the user to enter the number of teams participating in the tournament (for
simplicity, only allow even number of teams) and get the details of each team. The details should be
saved in a list of dictionaries, where each team is represented by a dictionary. For each team you should
get at least the name of the team, the number of matches it has played before, number of matches
won, and lost. You can get any additional details if you want to enhance the assignment on your own
 Generate and show a schedule for the tournament by randomly deciding which team should play
against which team. For each match, identify the chance of winning for both the teams based on their
past won and lost match records. An example of how to calculate the winning chance of two teams is
given below:

Winning Rate (WR) = (Won / (Won + Lost)) x 100


Winning Chance (WC) of Team 1 = (WR of Team 1 / (WR of Team 1 + WR of Team 2)) x 100

 Show the schedule of the matches in such a way that it is clear, understandable, and appealing
 Enter the results of the current round: the program should ask the user to enter the result of each
match of this round one by one. Based on the entered information, the data of won and lost should be
updated in the teams’ details list. A new schedule should be generated using only the teams who have
won their matches

 You can create other options as well in the menu which you think might be required to fulfill the
requirements given above

Solution:

Paste your code here. If you only give screen shot of the code, it will not be evaluated, and you will
get zero.

Insert screen shot for output here

Вам также может понравиться