Assignment brief 1 (1)
Assignment brief 1 (1)
Academic Year
Unit Tutor
Submission Format:
Format: The submission is in the form of an individual written report and a demonstration of how your code
works. This should be written in a concise, formal business style using single spacing and font size 12.
You are required to make use of headings, paragraphs and subsections as appropriate, and all work
must be supported with research and referenced using the Harvard referencing system. Please also
provide a bibliography using the Harvard referencing system.
Submission: Students are compulsory to submit the assignment in due date and in a way requested by the Tutors.
The form of submission will be a soft copy in PDF posted on corresponding course of
http://cms.btec.edu.vn/
Note: The Assignment must be your own work, and not copied by or from another student or from
books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must
reference your sources, using the Harvard style. Make sure that you know how to reference properly, and that
understand the guidelines on plagiarism. If you do not, you definitely get fail
Scenario: You are a student who wants to calculate your GPA (grade point average) based on your grades in
different courses. You decide to write a Python program that can do this task for you. Your program should:
Define a function to calculate the GPA given a list of grades and their corresponding credits. The formula for GPA is
the sum of the products of each grade and its credit divided by the total credits.
Requirements
The GPA calculator program must meet the following requirements:
It must be able to store the student's name and grades in a list.
It must be able to calculate the GPA using a function.
It must be able to handle errors and invalid input.
It must be able to print the results to a text file.
In order to do this, you can use the following steps:
Page 1
Create a calculate_gpa() function to calculate GPA. This function will take a list of component scores as input
and return the GPA score.
Use list to store the list of component scores and credits.
Create a print_gpa() function to print the GPA.
Prompt the user to enter course grade and corresponding credits.
Handle error cases, invalid input cases. For example, if the user enters an invalid name, the program will print
an error message.
Print the results to a text file.
Tasks
P1: Provide a definition of the data type that you use for the variables.
Identify the variables used in the program.
Specify the data type for each variable.
Briefly explain the reason for choosing the selected data type.
P2: Explain the error handling process.
Describe the types of errors that the program might encounter.
Outline the steps involved in handling errors using a try-except block.
P3: Determine the steps taken from writing code to execution.
List the steps involved in writing and executing the program.
Briefly explain the purpose of each step.
Identify the tools and resources used for writing and executing the program.
LO1 Understand Fundamental Programming Concepts D1: Evaluate the impact of different
data types on the performance and
P1 Provide a definition of the M1 Compare the advantage and memory usage of the program.
data type that you use for the disadvantage of variables type
variables. D2: Evaluate the use of try-except-
M2 Examine how the debugging finally blocks and custom exceptions
P2 Explain the error handling process can be used to help develop to handle errors and provide
process. more secure, robust applications. meaningful feedback to the user.
LO2 Utilize Python for Basic Problem Solving D3 Evaluate the role and purpose of
a coding standard and why it is
P3 Determine the steps taken M3 Analyse the process of writing necessary in a team as well as for the
Page 2
from writing code to execution. code, including the potential individual.
challenges faced.
Page 3