You are on page 1of 10

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Computing Fundamental

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Nguyễn Như Đạt Student ID BH01647

Class Com1900 Assessor name DINH VAN DONG

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature Toan

Grading grid

P1 P2 P3 M1 M2 M3 D1 D2 D3
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:
nten Co ts
P1: Provide a definition of the data type that you use for the variables......................................................................4
1.1. Identify the variables used in the program..................................................................................................4
1.2. Specify the data type for each variable........................................................................................................4
1.3. Briefly explain the reason for choosing the selected data type...................................................................4
P2: Explain the error handling process........................................................................................................................5
2.1. Describe the types of errors that the program might encounter......................................................................5
2.2. Outline the steps involved in handling errors using a try-except block............................................................5
P3: Determine the steps taken from writing code to execution..................................................................................6
3.1. List the steps involved in writing and executing the program...........................................................................6
3.2. Briefly explain the purpose of each step...........................................................................................................6
3.3. Identify the tools and resources used for writing and executing the program.................................................6
P1: Provide a definition of the data type that you
use for the variables.

1.1. Identify the variables used in the program.


 Definition of variable, what is variable?
 Any factor that can be controlled, changed, or measured in an experiment.
Scientific experiments have several types of variables. Independent and
dependent variables are the ones most often plotted on a graph or chart, but
there are other types of variables you may encounter.
 Variables are used in programs and programming for what?
 Variables are an important concept in programming because they help
developers store and change values in a program. This allows the program to be
flexible and able to perform calculations and data processing.
 How are variables usually named?
 Choose a name that when others read it, they can understand the purpose you
use it for and its meaning in the places you call it.
 Example of variable usage
 list_of_student_in_class_12t1_will_graduate_in_2017

 There is an image of variables in a Python program


1.2. Specify the data type for each variable.


Kiểu số ( số nguyên, số thực)
A real number type is a data type used in computer programs to approximately represent a real
number. Because real numbers are uncountable, with a finite amount of information, computers
cannot represent real numbers accurately. Usually, to represent a real number, computers will use an
approximate rational equivalent
Kiểu chuỗi ký tự
Kiểu bool

Tham khảo trong slide về các kiểu dữ liệu cho biến

1.3. Briefly explain the reason for choosing the selected data type.
Giải thích lý do lựa chọn các kiểu dữ liệu trong chương trình.

Tại sao chọn biến kiểu số nguyên (integer)


Tại sao chọn biến kiểu số thực (float)
Tại sao chọn biến kiểu string

P2: Explain the error handling process.

2.1. Describe the types of errors that the program might encounter.
Mô tả về các loại lỗi cần xử lý trong chương trình Python

2.2. Outline the steps involved in handling errors using a try-except


block.
Từng bước xử lý bắt lỗi sử dụng try-except
Cho ví dụ về việc bắt lỗi
P3: Determine the steps taken from writing code to
execution.

3.1. List the steps involved in writing and executing the program.
Đưa ra quy trình từng bước xử lý bài toán
Giải thích từng bước thực hiện chương trình.
Giải thích cả về mã nguồn

Thứ tự từng bước lập trình như sau:

 Create a calculate_gpa() function to calculate GPA. This function will take a list of component scores as input
and return the GPA score. – Hàm tính toán giá trị gpa . Đầu vào là list object bao gồm (Điểm , Tín chỉ )

 Use list to store the list of component scores and credits.

- Trình bày về Tuple trong Python và cách sử dụng, cách duyệt list
 Create a print_gpa() function to print the GPA.
- Viết hàm print_gap để in giá trị dữ liệu
 Prompt the user to enter course grade and corresponding credits.
- Hàm nhập thông tin điểm + tín chỉ
 Handle error cases, invalid input cases. For example, if the user enters an invalid name, the program will print
an error message.
- Xử lý lỗi ngoại lệ try exception trong Python
 Print the results to a text file.
- Xử lý việc lưu vào file
3.2. Briefly explain the purpose of each step.

Giải thích mục tiêu thực hiện của mỗi bước.


Ví dụ đoạn mã này dùng để nhập dữ liệu
Ví dụ đoạn mã này để xử lý ghi vào file
Ví dụ đoạn mã hiển thi dữ liệu ra màn hình
Ví dụ đoạn mã tính toán cộng thực GPA

3.3. Identify the tools and resources used for writing and executing
the program.

Xác định cộng cụ, tài nguyên sử dụng viết và thực hiện chương trình
Giới thiệu về Pycharm / Visual Studio Code
Hướng dẫn cách sử dụng Pycharm / Visual Studio Code (Viết mã nguồn, thực thi chạy chương
trình)

Conclusion

Kết luận : Đưa ra tổng kết về Assignment


Những điều học được và tổng kết được
Hạn chế chưa đạt được
Lời cảm ơn
References
Tài liệu tham khảo
Tuân thủ theo chuẩn Harvard theo ảnh bên dưới.:
Books:
Tên tác giả, năm phát hành, tên bài báo, sách
Website:
Tên tác giả, thời gian viết, Chú đề. Available:
Link website

You might also like