Python Programming Project: Wage Commission Application
VerifiedAdded on 2025/05/03
|17
|3550
|403
AI Summary
Desklib provides solved assignments and past papers to help students succeed.

Unit 1
Programming
1
Programming
1
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Introduction.................................................................................................................................................3
L01..............................................................................................................................................................4
P1.................................................................................................................................................4
M1................................................................................................................................................6
LO2.............................................................................................................................................................7
P2.................................................................................................................................................7
M2..............................................................................................................................................10
LO3...........................................................................................................................................................11
P3...............................................................................................................................................11
M3..............................................................................................................................................13
LO4...........................................................................................................................................................14
P4...............................................................................................................................................14
P5...............................................................................................................................................15
M4..............................................................................................................................................16
Conclusion.................................................................................................................................................17
References.................................................................................................................................................18
2
Introduction.................................................................................................................................................3
L01..............................................................................................................................................................4
P1.................................................................................................................................................4
M1................................................................................................................................................6
LO2.............................................................................................................................................................7
P2.................................................................................................................................................7
M2..............................................................................................................................................10
LO3...........................................................................................................................................................11
P3...............................................................................................................................................11
M3..............................................................................................................................................13
LO4...........................................................................................................................................................14
P4...............................................................................................................................................14
P5...............................................................................................................................................15
M4..............................................................................................................................................16
Conclusion.................................................................................................................................................17
References.................................................................................................................................................18
2

Introduction
The project is to develop a wage commission application by understanding the case study giving
in the assignment. The project is based on Python language. The case study is about a top
competitive retailer who decides to reward the staff by introducing a wage increase system which
will be based on their sales every month. The commission rate list is provided by the retailer
which shows the commission rate based on the sales amount per month. The basic salary will
remain as same as before. In addition, the incentive amount will be added to the basic salary
based on the sales on the same month. This project will reflect the basics of the Python language
and the role of algorithms that are used to develop an application on an integrated development
environment.
3
The project is to develop a wage commission application by understanding the case study giving
in the assignment. The project is based on Python language. The case study is about a top
competitive retailer who decides to reward the staff by introducing a wage increase system which
will be based on their sales every month. The commission rate list is provided by the retailer
which shows the commission rate based on the sales amount per month. The basic salary will
remain as same as before. In addition, the incentive amount will be added to the basic salary
based on the sales on the same month. This project will reflect the basics of the Python language
and the role of algorithms that are used to develop an application on an integrated development
environment.
3
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

L01
P1:
An algorithm is defined as a logical step by step method which is used for processing of data or
for solving a problem. An algorithm is a recipe in the dish without which we cannot make the
dish. Algorithms are used widely in several areas like mathematics or computer programming.
An algorithm can be used in various ways like the insertion of data, searching of data or sorting.
Execution of an algorithm includes focusing on the aim, following the continuous steps and
running the whole process until the desired output is received (Edrawsoft, 2019). For example,
take any search engine, the search engine follows the algorithm in which the user inputs a string
which works as an input for the algorithm. The algorithm searches the database for similar
keywords and presents the relevant websites.
To develop an algorithm you need to follow the steps below:
• Acquire the problem: In this step, you need to read the description of the problem and
identify the defects being the developer. The description can have unjustified assumptions, can
be incomplete. It is your job to rectify the description of the problem.
• Analyze: In this step, you need to discover the starting points and the ending points to solve
the problem. You need to dig down deep in the problem statement and determine what data is
provided, what are the formulas required to solve the problem, what will be the rules and the
relationship amongst the data values. For the ending point, you need to determine which values
will change, what values won’t exist.
• Development: To write an algorithm you need all the data obtained from the problem. Then
the data will be carried out in a logical step by step process to obtain the desired output.
For example: Taking a problem statement where you have to add 2 numbers.
1. Let the user input the first number.
2. Let the user input the second number.
3. Use the operator ‘+’ to add the two numbers provided by the user.
4
P1:
An algorithm is defined as a logical step by step method which is used for processing of data or
for solving a problem. An algorithm is a recipe in the dish without which we cannot make the
dish. Algorithms are used widely in several areas like mathematics or computer programming.
An algorithm can be used in various ways like the insertion of data, searching of data or sorting.
Execution of an algorithm includes focusing on the aim, following the continuous steps and
running the whole process until the desired output is received (Edrawsoft, 2019). For example,
take any search engine, the search engine follows the algorithm in which the user inputs a string
which works as an input for the algorithm. The algorithm searches the database for similar
keywords and presents the relevant websites.
To develop an algorithm you need to follow the steps below:
• Acquire the problem: In this step, you need to read the description of the problem and
identify the defects being the developer. The description can have unjustified assumptions, can
be incomplete. It is your job to rectify the description of the problem.
• Analyze: In this step, you need to discover the starting points and the ending points to solve
the problem. You need to dig down deep in the problem statement and determine what data is
provided, what are the formulas required to solve the problem, what will be the rules and the
relationship amongst the data values. For the ending point, you need to determine which values
will change, what values won’t exist.
• Development: To write an algorithm you need all the data obtained from the problem. Then
the data will be carried out in a logical step by step process to obtain the desired output.
For example: Taking a problem statement where you have to add 2 numbers.
1. Let the user input the first number.
2. Let the user input the second number.
3. Use the operator ‘+’ to add the two numbers provided by the user.
4
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

4. Show the result to the user.
• Review: The final step is to review the algorithm and check if it solves the problem statement
or not. If it solves the problem statement then check if there is any other way to optimize the
code for better compilation time and lower complexity.
M1:
On the first step we have created a variable of the basic salary and we have stored the basic
monthly salary in it.
In the second step, we have created a function with the help of ‘def’ keyword. A function is a set
of code in which you can pass desired data which are known as parameters and use it for any
defined purpose. A function runs only when it is called in the execution.
In the third step, we have defined the function using conditional statements such as ‘if’ and ‘elif’.
If statement is written using ‘if’ keyword. If statements run on logical conditions which if true
runs the code which is inside the if statement and returns the output. Elif statements use the ‘elif’
keyword for implementation (Moon, 2018). The elif statements run only if the previous
conditions weren’t true. These statements have logical conditions which evaluate the output for
the user when the user enters the input.
In the fourth step, we have used the ‘input’ keyword which allows the user to input the data. The
data is then stored in a variable.
In the fifth step, we have used the while statement to check if the user wants to exit the program
or not. If yes then the program automatically shuts down when the user inputs ‘exit’. But if not
then the try block will execute the function defined using the input data and generate an output.
If the user enters any other value like integer values then the program will automatically display
an error message.
5
• Review: The final step is to review the algorithm and check if it solves the problem statement
or not. If it solves the problem statement then check if there is any other way to optimize the
code for better compilation time and lower complexity.
M1:
On the first step we have created a variable of the basic salary and we have stored the basic
monthly salary in it.
In the second step, we have created a function with the help of ‘def’ keyword. A function is a set
of code in which you can pass desired data which are known as parameters and use it for any
defined purpose. A function runs only when it is called in the execution.
In the third step, we have defined the function using conditional statements such as ‘if’ and ‘elif’.
If statement is written using ‘if’ keyword. If statements run on logical conditions which if true
runs the code which is inside the if statement and returns the output. Elif statements use the ‘elif’
keyword for implementation (Moon, 2018). The elif statements run only if the previous
conditions weren’t true. These statements have logical conditions which evaluate the output for
the user when the user enters the input.
In the fourth step, we have used the ‘input’ keyword which allows the user to input the data. The
data is then stored in a variable.
In the fifth step, we have used the while statement to check if the user wants to exit the program
or not. If yes then the program automatically shuts down when the user inputs ‘exit’. But if not
then the try block will execute the function defined using the input data and generate an output.
If the user enters any other value like integer values then the program will automatically display
an error message.
5

LO2
P2:
Procedural programming in one of the programming paradigm in which is built on the concept of
using procedures. A program written on the basis of procedural paradigm includes data and
procedures in which every statement commands the system to do something (Edrawsoft, 2019).
The procedure is a set of commands that needs to be executed. This paradigm is broadly used for
large projects as it has features like re-usability of code and proper maintenance.
The characteristics of the procedural paradigm are as follows:
• It mainly concentrates on functions rather than data.
• Division of programs into sub programs which are called functions.
• All the functions share global data.
• Uninterrupted movement of data from one function to another.
• The top-down approach is followed.
Object oriented programming is a paradigm which follows the object oriented approach. It is
based on the concept of combining the function and data together in a unit which is known as an
object. Its main focus is on objects rather than the procedure (Hayes, 2017). Objects are instances
of classes. These instance interacts with each other to design programs and applications.
The characteristics of object oriented programming are:
• Abstraction: It focuses on representing the essential data and hiding the background details to
the real world.
• Encapsulation: It binds the data and operations under a single unit and secures it from outside
malicious attacks.
• Polymorphism: It is the ability of a message to transform in many forms. In other words, the
same function with different functionalities.
6
P2:
Procedural programming in one of the programming paradigm in which is built on the concept of
using procedures. A program written on the basis of procedural paradigm includes data and
procedures in which every statement commands the system to do something (Edrawsoft, 2019).
The procedure is a set of commands that needs to be executed. This paradigm is broadly used for
large projects as it has features like re-usability of code and proper maintenance.
The characteristics of the procedural paradigm are as follows:
• It mainly concentrates on functions rather than data.
• Division of programs into sub programs which are called functions.
• All the functions share global data.
• Uninterrupted movement of data from one function to another.
• The top-down approach is followed.
Object oriented programming is a paradigm which follows the object oriented approach. It is
based on the concept of combining the function and data together in a unit which is known as an
object. Its main focus is on objects rather than the procedure (Hayes, 2017). Objects are instances
of classes. These instance interacts with each other to design programs and applications.
The characteristics of object oriented programming are:
• Abstraction: It focuses on representing the essential data and hiding the background details to
the real world.
• Encapsulation: It binds the data and operations under a single unit and secures it from outside
malicious attacks.
• Polymorphism: It is the ability of a message to transform in many forms. In other words, the
same function with different functionalities.
6
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

• Inheritance: It is the ability of a class to get derived from another existing class. The existing
classes are known as base classes whereas the other class is called the derived or child classes.
The features of object oriented programming are:
• It focuses on data more than the procedures.
• It follows the bottom-up approach.
• Reusability of code.
• Data is protected.
• Communication of objects through functions.
Event-driven programming is currently one of the most used programming paradigms in the
software industry (Moon, 2018). Events are used to develop any software. The program is an
event-driven response to every event initiated by the user. The idea is to react. Events can be
anything like click on a button, entry from a list, input in a text box, etc. the events are observed
by an event listener(code). If any event happens then event handler is called. The event handler
can be any function or method which triggers anytime an event happens.
The characteristics of event-driven programming are mentioned below:
• Service Oriented: This feature consumes a little processing power of the system and writes
the programs that are made of the services. It usually runs in the background without interfering
with the user work.
• Time Driven: This feature of event-driven programming runs on a specific interval of time. It
can be a particular code that executes on a defined time, it could be once in a month, once in 3
days or once in a week.
• Event Handlers: These are the functions that run when a specific event happens. For example,
it can be a button which when clicked runs a specific code and when again pressed runs the code
again.
• Trigger Functions: These functions are triggered when a specific event occurs and it decides
which code to execute for the event and which event handler to select for the event (Python,
2019).
7
classes are known as base classes whereas the other class is called the derived or child classes.
The features of object oriented programming are:
• It focuses on data more than the procedures.
• It follows the bottom-up approach.
• Reusability of code.
• Data is protected.
• Communication of objects through functions.
Event-driven programming is currently one of the most used programming paradigms in the
software industry (Moon, 2018). Events are used to develop any software. The program is an
event-driven response to every event initiated by the user. The idea is to react. Events can be
anything like click on a button, entry from a list, input in a text box, etc. the events are observed
by an event listener(code). If any event happens then event handler is called. The event handler
can be any function or method which triggers anytime an event happens.
The characteristics of event-driven programming are mentioned below:
• Service Oriented: This feature consumes a little processing power of the system and writes
the programs that are made of the services. It usually runs in the background without interfering
with the user work.
• Time Driven: This feature of event-driven programming runs on a specific interval of time. It
can be a particular code that executes on a defined time, it could be once in a month, once in 3
days or once in a week.
• Event Handlers: These are the functions that run when a specific event happens. For example,
it can be a button which when clicked runs a specific code and when again pressed runs the code
again.
• Trigger Functions: These functions are triggered when a specific event occurs and it decides
which code to execute for the event and which event handler to select for the event (Python,
2019).
7
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

• Events: Events can be anything that the user is interacting with. It can be a button which is
clicked by the mouse or selected by the keyboard. Events happen because of the code which is
assigned to them.
• Simple programming & Easy development: Event driven programming makes the
development simpler and easier than other programming paradigms. Event-driven programming
makes it easy for the user to place pre-defined codes onto any applications which make it very
visual and interactive (Veracode, 2019).
Relationship between procedural, object-oriented and event-driven programming
Procedural Programming Paradigm Object-Oriented Programming Paradigm Event-Driven
Programming Paradigm
Focuses on procedure Focuses on objects and methods Focuses on the selection from the user
interface
Uses character user interface Uses command writing Uses Graphical User Interface
Execution of code depends on the written commands in the program Execution depends on the
interaction of objects and methods Execution of code depends on the occurrence of the event
Languages: C, C++, PHP, Lisp, etc (Moon, 2018). Languages: JavaScript, Visual Basic, Elm,
etc. Languages: C++, C#, Java, Ruby, Python, etc.
M2:
The integrated development environment is a software that helps in the creation of code, the
building of code and testing of code. These IDEs includes basic tools for executing these
processes. IDE makes it easier of a developer to write code as most IDEs have code editor and it
makes it simpler to organize the code with no redundancies (Veracode, 2019). Some IDE focuses
on a particular language like Java or python but most of them adapt to every language. IDE
comprises of all the tools that a developer needs under one platform such as,
Code Editor- It features like a text editor which helps the user to write and edit the source code.
8
clicked by the mouse or selected by the keyboard. Events happen because of the code which is
assigned to them.
• Simple programming & Easy development: Event driven programming makes the
development simpler and easier than other programming paradigms. Event-driven programming
makes it easy for the user to place pre-defined codes onto any applications which make it very
visual and interactive (Veracode, 2019).
Relationship between procedural, object-oriented and event-driven programming
Procedural Programming Paradigm Object-Oriented Programming Paradigm Event-Driven
Programming Paradigm
Focuses on procedure Focuses on objects and methods Focuses on the selection from the user
interface
Uses character user interface Uses command writing Uses Graphical User Interface
Execution of code depends on the written commands in the program Execution depends on the
interaction of objects and methods Execution of code depends on the occurrence of the event
Languages: C, C++, PHP, Lisp, etc (Moon, 2018). Languages: JavaScript, Visual Basic, Elm,
etc. Languages: C++, C#, Java, Ruby, Python, etc.
M2:
The integrated development environment is a software that helps in the creation of code, the
building of code and testing of code. These IDEs includes basic tools for executing these
processes. IDE makes it easier of a developer to write code as most IDEs have code editor and it
makes it simpler to organize the code with no redundancies (Veracode, 2019). Some IDE focuses
on a particular language like Java or python but most of them adapt to every language. IDE
comprises of all the tools that a developer needs under one platform such as,
Code Editor- It features like a text editor which helps the user to write and edit the source code.
8

Compiler- This feature is used for converting the programming language into binary code which
machine can process. After the analyzation of code, the code is parsed by the compiler and
optimized to its optimal performance.
Debugger- This tool comes in use during the testing. It helps in debugging the application
programs and to solve any bugs if detected.
Automation Tools- These are the tools which help the developer to handle common tasks.
Some IDEs are commercial but many of them are open source.
The main goal of an integrated development environment is to help the developer develop
applications and software easily which would eventually improve the productivity of the
developer (Hayes, 2017). An IDE helps the developer to use all the essential tools at one place
instead of spending a large amount of time configuring other development tools providing the
same features. An IDE helps in faster development of applications as the parsing of the code,
checking the syntax of the code while editing the same code happens at one place. An IDE gets
updated on regular bases which helps the developer to learn new things if anything new appears
in the update. This helps the developer to be up-to-date in the market.
9
machine can process. After the analyzation of code, the code is parsed by the compiler and
optimized to its optimal performance.
Debugger- This tool comes in use during the testing. It helps in debugging the application
programs and to solve any bugs if detected.
Automation Tools- These are the tools which help the developer to handle common tasks.
Some IDEs are commercial but many of them are open source.
The main goal of an integrated development environment is to help the developer develop
applications and software easily which would eventually improve the productivity of the
developer (Hayes, 2017). An IDE helps the developer to use all the essential tools at one place
instead of spending a large amount of time configuring other development tools providing the
same features. An IDE helps in faster development of applications as the parsing of the code,
checking the syntax of the code while editing the same code happens at one place. An IDE gets
updated on regular bases which helps the developer to learn new things if anything new appears
in the update. This helps the developer to be up-to-date in the market.
9
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

LO3
P3:
The above code in written and developed in PyCharm. PyCharm is an IDE (Integrated
Development Environment) which is specially designed for Python language.
Coming to the coding part,
Step 1: We have assigned the basic salary amount per month to a variable called salary_base.
Step 2: We have declared a function named calcSalary using def keyword in which we have
passed a parameter named sale_amt.
Step 3: We have defined the calcSalary function using conditional statements such as if and elif.
In these conditional statements, we have written logical conditions which calculate the salary
based on the amount of sale done by the employee.
Step 4: We prompted the user to enter the sale amount to calculate the salary or type exit to exit
the program using the input keyword (Edrawsoft, 2019). The numerical value entered by the user
is then stored in the variable named as a choice.
Step 5: We run a while loop in which we check the value submitted by the user. If the value is
not ‘exit’ then the loop will run the try block code in which we have called the function
calcSalary with the parameter being the value provided by the user (Veracode, 2019). After
calling the function the salary will be calculated and displayed on the screen.
But if the value is integral or anything else then the program will automatically display an error
message.
The output windows are listed below:
Input 1: I submitted the sales amount of 6000 which eventually gets accepted by the program
which triggers the calling of the function which calculates the salary and then the salary 3013.33
is displayed to the user.
Input 2: I submitted an integer value of 5000.50 which doesn’t get accepted and the error
message is displayed to the user.
10
P3:
The above code in written and developed in PyCharm. PyCharm is an IDE (Integrated
Development Environment) which is specially designed for Python language.
Coming to the coding part,
Step 1: We have assigned the basic salary amount per month to a variable called salary_base.
Step 2: We have declared a function named calcSalary using def keyword in which we have
passed a parameter named sale_amt.
Step 3: We have defined the calcSalary function using conditional statements such as if and elif.
In these conditional statements, we have written logical conditions which calculate the salary
based on the amount of sale done by the employee.
Step 4: We prompted the user to enter the sale amount to calculate the salary or type exit to exit
the program using the input keyword (Edrawsoft, 2019). The numerical value entered by the user
is then stored in the variable named as a choice.
Step 5: We run a while loop in which we check the value submitted by the user. If the value is
not ‘exit’ then the loop will run the try block code in which we have called the function
calcSalary with the parameter being the value provided by the user (Veracode, 2019). After
calling the function the salary will be calculated and displayed on the screen.
But if the value is integral or anything else then the program will automatically display an error
message.
The output windows are listed below:
Input 1: I submitted the sales amount of 6000 which eventually gets accepted by the program
which triggers the calling of the function which calculates the salary and then the salary 3013.33
is displayed to the user.
Input 2: I submitted an integer value of 5000.50 which doesn’t get accepted and the error
message is displayed to the user.
10
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Input 3: I submitted the ‘exit’ value to the program and the program executed the request and
finished the process with exit code 0.
Figure 1: Program Code
Figure 2: Program Output
M3:
11
finished the process with exit code 0.
Figure 1: Program Code
Figure 2: Program Output
M3:
11

An IDE is a centralized software which comprises of various tools which help the developer to
handle everything on one platform instead of configuring different things manually. Almost
every IDE at least consists of a code editor, a compiler, a debugger and automation tools
(Veracode, 2019). An IDE manages the development process of a problem using features like:
• Highlighting the syntax by adding different colours and different fonts to every keyword
which makes the environment more creative, interactive and calm to work on.
• The most beautiful feature on IDEs is the smart code completion which boosts the
programming speed of the developer resulting in an increase in productivity.
• An IDE also comprises of a compiler which converts the programming code into binary code
for the machine to execute.
• The inbuilt graphical debugger tool helps the developer the most as it helps the developer to
detect the bug rapidly and fix it more effectively.
• The code search feature is also a cherry on the top as it helps the developer to locate classes,
functions, methods or variables in an instance.
• The visual programming helps the developer to create new software and applications more
efficiently as it allows the developer to drag and drop pre-defined lines of code with just a point
and click.
• Cross-language functionalities make the work environment easier to a beginner entering the
world of any IDE. Example: Eclipse, IntelliJ IDEA, etc.
• Some advance IDEs also provide refactoring. Automated refactoring refers to an S2S
(Source-to-source) compiler which takes source code written in any programming language and
converts the source code into a different programming language.
LO4
P4:
Debugging process is the most important process for any developer. In this process, the bugs and
errors are detected, analyzed and resolved (Moon, 2018). The debugging process begins when
12
handle everything on one platform instead of configuring different things manually. Almost
every IDE at least consists of a code editor, a compiler, a debugger and automation tools
(Veracode, 2019). An IDE manages the development process of a problem using features like:
• Highlighting the syntax by adding different colours and different fonts to every keyword
which makes the environment more creative, interactive and calm to work on.
• The most beautiful feature on IDEs is the smart code completion which boosts the
programming speed of the developer resulting in an increase in productivity.
• An IDE also comprises of a compiler which converts the programming code into binary code
for the machine to execute.
• The inbuilt graphical debugger tool helps the developer the most as it helps the developer to
detect the bug rapidly and fix it more effectively.
• The code search feature is also a cherry on the top as it helps the developer to locate classes,
functions, methods or variables in an instance.
• The visual programming helps the developer to create new software and applications more
efficiently as it allows the developer to drag and drop pre-defined lines of code with just a point
and click.
• Cross-language functionalities make the work environment easier to a beginner entering the
world of any IDE. Example: Eclipse, IntelliJ IDEA, etc.
• Some advance IDEs also provide refactoring. Automated refactoring refers to an S2S
(Source-to-source) compiler which takes source code written in any programming language and
converts the source code into a different programming language.
LO4
P4:
Debugging process is the most important process for any developer. In this process, the bugs and
errors are detected, analyzed and resolved (Moon, 2018). The debugging process begins when
12
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 17
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.


