Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
160 views

BMCS2713 Introduction To Python Programming (Q)

Uploaded by

永翔
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views

BMCS2713 Introduction To Python Programming (Q)

Uploaded by

永翔
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

TUNKU ABDUL RAHMAN UNIVERSITY OF MANAGEMENT AND TECHNOLOGY

FACULTY OF COMPUTING AND INFORMATION TECHNOLOGY

ACADEMIC YEAR 2024/2025

OCTOBER FINAL ASSESSMENT

BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

Final Assessment Question Release Date: WEDNESDAY, 18 SEPTEMBER 2024


Date of Submission: SATURDAY, 5 OCTOBER 2024

Instructions to Candidates:
● Choose only ONE (1) Project out of the three Projects given.
● This is the final assessment. You MUST answer the assessment questions on your own
without seeking any assistance from other third party/people.
● In preparing the final assessment answers, you MUST adhere strictly to the University’s
plagiarism policy.
● You must contact your lecturer should there be any questions whilst preparing the final
assessment answers.
● It is your responsibility to ensure all pages of the answer script are submitted. You will not be
notified for any missing pages or incorrect submission of answer scripts.
● You must submit your answers to the designated location by the submission deadline stated in
the final assessment.
● For students who submit their answers late, PENALTY WILL BE IMPOSED as follows:
○ Late submission of 1 - 3 days after deadline of submission: minus 10 marks
○ Late submission of 4 - 7 days after deadline of submission: minus 20 marks
○ Late submission of > 7 days after deadline of submission: 0 mark
● For Extenuation Mitigating Circumstance (EMC) encountered, if any, the application must be
submitted to the faculty within 48 hours after the submission date of this final assessment. All
EMC applications must be supported with valid reasons and evidence. The TAR UMT EMC
Guidelines apply.

Additional Instructions to Candidates:


● State your INDEX Number on the cover page of your submission of answer. The index number
can be obtained from the Examination Authorisation Slip.
● DO NOT include any other personal information/details in your answer sheet/submission work.
● Read all the questions carefully and understand what you are being asked to answer.
● Marks are awarded for your own (original) analysis. Therefore, use the time and information to
build well-constructed answers.

STUDENT’S DECLARATION OF ORIGINALITY


● By submitting the final assessment answer, I declare that this submitted work is free from all
forms of plagiarism and for all intents and purposes is my own properly derived work.
● I confirm that the submitted work, presented ideas or arguments were not derived from any
generative AI tools or other sources.
● I agree that use of generative AI tools without acknowledgement for the final assessment
answers will be treated as academic misconduct and is subject to disciplinary action by the
University.

This final assessment consists of 1 questions on 7 printed pages.


2
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

Instruction: Choose one from the three projects in this assessment. Each carries 100
marks. Submit a report based on the report template in each project.

Project 1: Discounted Cash Flow Value


1.1 Project Overview
The objective of this assignment is to create a Python program that calculates the Discounted Cash
Flow (DCF) value of an investment based on user-inputted cash flows and a discount rate. The
program will also plot a graph of the future cash flows, Valuet=0 in the period n.

(equation 1)
where Cash flowt, and r are cash flow in the period t and interest rate, respectively.

1.2 Instructions:

1. Get User Input for Cash Flows and Discount Rate:


o Prompt the user to input cash flows for each period until they type 'done'.
o Prompt the user to input the discount rate.
2. Calculate the DCF Value:
o Implement a function calculate_dcf (cash_flows, discount_rate) to calculate the DCF
value.
o The DCF value is the sum of each cash flow divided by (1 + discount rate) raised to
the power of the period number.
3. Plot the Future Cash Flows:
o Use the matplotlib library to plot a graph of the future cash flows.

1.3 Requirements:

1. Function calculate_dcf (cash_flows, discount_rate):


o Inputs:
▪ cash_flows: A list of expected cash flows for each period.
▪ discount_rate: The discount rate as a decimal (e.g., 0.10 for 10%).
o Output:
▪ The present value of the expected cash flows (DCF value).
2. Function get_cash_flows():
o Repeatedly prompts the user to input cash flows until 'done' is entered.
o Returns a list of cash flows.
3. Main Function:
o Calls get_cash_flows() to get the cash flows from user input.
o Prompts the user to input the discount rate.
o Calculates the DCF value using calculate_dcf().
o Prints the DCF value.
o Plots the future cash flows using matplotlib.
4. Plotting:
o The plot should display periods on the x-axis and cash flows on the y-axis.
o The plot should have a title, labels for the axes, and a grid.

This final assessment consists of 3 questions on 7 printed pages.


3
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

5. Additional Task (Optional):


o Implement robust error handling to manage invalid inputs (e.g., non-numeric values
for cash flows or discount rates).
o Provide clear and informative error messages to help users correct their inputs.
o Generate a detailed report of the DCF calculation, including a breakdown of each
cash flow, the discount factor applied, and the present value of each cash flow. Export
the report as a PDF or CSV file.
1.4 Submission:

1. Ensure your Python script is named appropriately (e.g., dcf_analysis.py).


2. Submit your script along with a screenshot of the output and the graph of future cash flows.

1.5 Report Template:

Use the following template for your report:

Discounted Cash Flow Report


1. Introduction
-Provide objective of the project and the importance of DCF.
2. Methodology
3. Implementation
-Provide flowchart describing the algorithm of the program.
4. Results
-Test with various results of cashflow that you can find in the industry.
5. Analysis
-Include analysis of your results.
6. Summary
-Summarize key findings.

Project 2: Banking Application


2.1 Project Overview

In this project, you will create a Python script to simulate a simple banking system. This system will
allow users to create accounts, deposit money, withdraw money, and check their account balances
using procedural programming. This mini project will help banking students gain hands-on experience
with Python programming and understand how to implement basic banking operations using
procedural programming. They will learn how to create functions, manage data, and interact with
users through a simple console-based interface.

2.2 Objectives

1. Implement a basic banking system with account management.


2. Allow users to perform transactions like deposits, withdrawals, and balance inquiries.
3. Use functions to structure the system.

2.3 Prerequisites

1. Basic knowledge of Python programming.

This final assessment consists of 3 questions on 7 printed pages.


4
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

2.4 Assignment Tasks

1. Define Account Management Functions


o Create a set of functions to represent bank account operations such as creating
accounts, depositing, withdrawing, and checking balances.
2. Implement User Interaction
o Implement a menu-driven interface to allow users to interact with the banking system.
Users should be able to create accounts, deposit money, withdraw money, and check
balances.
3. Testing and Documentation
o Test the banking system by creating accounts and performing various transactions.
o Document the code with comments explaining each function and its purpose.

4. Additional Tasks
o Create additional features for the application such as online bank transfer to other
account holder, registration of new account with new username and password as well
as username and password verification for access to the system.
2.5 Report Template

Use the following template for your report:

Banking System Simulation Report

1. Overview
Provide a brief overview of the banking system simulation.

2. Flowchart
Provide a flowchart for the algorithm of your program.

3. Account Management Functions


Explain the implementation of the account management functions.

4. User Interaction
Detail the menu-driven interface and how users can interact with the system.

5. Testing
Summarize the testing process and the results of various transactions.

6. Conclusion
Discuss any challenges faced during the implementation and any potential improvements for future
versions.

Project 3: A Simple Game with Pygame


3.1 Project Overview

In this project, you will create a simple game using the Pygame library. The player will control a
character that moves around the screen and tries to avoid falling obstacles. The game will include
basic game mechanics like player movement, collision detection, and score tracking. This mini project
will help students learn the basics of Pygame and game development, including setting up a game
loop, handling user input, and implementing basic game mechanics.

This final assessment consists of 3 questions on 7 printed pages.


5
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

3.2 Objectives

1. Set up a Pygame window.


2. Implement player controls to move the character.
3. Create obstacles that fall from the top of the screen.
4. Detect collisions between the player and obstacles.
5. Track and display the player's score.

3.3 Prerequisites

1. Basic knowledge of Python programming.


2. Installation of Pygame library.

You can install Pygame using pip:

pip install pygame

3.4 Assignment Tasks

1. Set Up the Pygame Window


o Ensure you have the screen dimensions, colors, and clock set up correctly.
o Display the Pygame window with a black background.
2. Implement Player Controls
o Add code to move the player left and right using arrow keys.
o Ensure the player cannot move outside the screen boundaries.
3. Create Falling Obstacles
o Write functions to create and draw obstacles that fall from the top of the screen.
o Randomize the position and speed of the falling obstacles.
4. Detect Collisions
o Implement collision detection between the player and the obstacles.
o End the game if a collision is detected.
5. Track and Display Score
o Keep track of the player's score based on the number of obstacles avoided.
o Display the score on the screen.

Additional Tasks (Optional)

Allow changes in speeds of falling objects and more sophisticated graphics and animations.

3.5 Testing and Documentation

1. Testing
o
Run the game and test player movement, obstacle creation, collision detection, and
score tracking.
o Ensure the game ends correctly when a collision occurs.
2. Documentation
o Add comments to the code explaining each function and major block of logic.
o Document the purpose of each section in a brief report.

This final assessment consists of 3 questions on 7 printed pages.


6
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

3.6 Report Template

Use the following template for your report:

Pygame Basic Game Project Report

1. Overview
Provide a brief overview of the game created.

2.Flowchart
Provide a simple flowchart describing your algorithm.

3. Pygame Window Setup


Explain the setup of the Pygame window and initial configurations.

4. Player Controls
Describe how player movement is implemented.

5. Falling Obstacles
Detail the creation and management of falling obstacles.

6. Collision Detection
Explain how collisions are detected between the player and obstacles.

7. Score Tracking
Summarize how the score is tracked and displayed.

8. Testing
Provide a summary of the testing process and results.

9. Conclusion
Discuss any challenges faced during the implementation and any potential improvements for future
versions.

This final assessment consists of 3 questions on 7 printed pages.


7
BMCS2713 INTRODUCTION TO PYTHON PROGRAMMING

Submission Deadline: 11.59 pm on 5 October 2024

For every single project, full marks of 100 marks will be awarded based on the following assessment
rubric:

Criteria Marks 0-5 6-10 11-15 16-20 21-25


Correctness 25 Code does Code meets Code meets Code meets Code meets all
not meet few some most specifications
specification specification specifications. specifications. and
s. Major s. Significant Notable errors Minor errors in requirements.
functionality functionality in functionality. All
errors. errors. functionality. functionalities
work correctly.
Criteria Marks 0-2 3-4 5-6 7-8 9-10
Documentation 10 Code is not Code has Code has Code is mostly Code is well-
& Comments documented little some documented organized,
. No documentati documentatio with clear follows best
comments on. Few n, but many comments. practices, and is
or comments functions and Most functions easy to
explanations and blocks are and complex understand
. explanations unexplained. blocks are
. explained
Criteria Marks 0-3 4-6 5-9 10-12 13-15
Code Structure 15 Code is Code is Code is Code is mostly Code is well-
& Organization disorganized poorly somewhat organized, organized,
, difficult to organized organized but follows best follows best
follow, and and difficult lacks some practices, and practices, and is
does not to follow. best practices. is easy to
follow best Lacks best understandabl understand.
practices. practices. e.
Criteria Marks 0-3 4-6 5-9 10-12 13-15
User Interface 15 User User User interface User interface User interface
interface is interface is is somewhat is clear and is intuitive,
confusing or unclear or clear but mostly user- clear, and user-
not user- not very could be more friendly. friendly.
friendly at user-friendly. user-friendly.
all.
Criteria Marks 0-1 2-2 3-3 4-4 5-5
Testing & 5 No testing is Minimal Some testing Testing is done Comprehensive
Debugging done. Code testing is is done, but but not testing is done.
is full of done. many cases comprehensiv Code is
issues and Several are untested. e. Minor issues thoroughly
bugs. issues remain. debugged and
remain. free of issues.
Criteria Marks 0-6 7-12 8-18 19-24 25-30
Report 30 Poor Below Average Good Very good
average

This final assessment consists of 3 questions on 7 printed pages.

You might also like