Docsity

Python Program for Calculating Cumulative GPA: A Step-by-Step Guide, Cheat Sheet of Computer science

Toggle sidebar
bg1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 1 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
Student ID
Class
Assessor name
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
Grading grid
P2
P3
M1
M3
D1
D3
pf3
pf4
pf5

Partial preview of the text

Download Python Program for Calculating Cumulative GPA: A Step-by-Step Guide and more Cheat Sheet Computer science in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 1 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 Student ID Class Assessor name 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 Grading grid P1 P2 P3 M1 M2 M3 D1 D2 D

❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date:

INTRODUCE:

This is a python program to calculate cumulative grade point average (gpa). It allows student to enter name, list of grades and list of credits. The formula for GPA is the sum of the products of each grade and its credit divided by the total credits CONTENT : P1 : Provide a definition of the data type that you use for the variables.

  • float : float is a numerical data type that represents a floating-point number.
  • int : int is a numeric data type that represents integers.
  • str : str is a string data type consisting of letters and characters. P1.1 :Identify the variables used in the program.
  • x = score1 , y = score2, z = score3 , t = score
  • scores = [x,y,z,t]
  • w = credit1, e = credit2, r = credit3, y = credit
  • credits[w,e,r,y] P1.2 :Specify the data type for each variable.
  • For the student name a I use “str” data type
  • For the score list I use “float” data type and credit list I use “int” data type. P1.3 : Briefly explain the reason for choosing the selected data type.
  • I choose "float" data type for "scores" variable because scores can be decimal like 6.5, 7.8, 5.
  • I use " int " for credit , because I want to take only integers to calculate credits. P2 : Explain the error handling process. P2.1 : Describe the types of errors that the program might encounter.
  • ValueError :Invalid In 2 data types "float" or "int", the input data can be filled with the wrong value.
  • Invalidname : Input contains numbers or special characters. P2.2 : Outline the steps involved in handling errors using a try-except block.
  • Step 1 : “try” test to check whether a calculation or value is true or false
  • Step 2: if correct, continue printing the value and end. If false , printing the name error.