Report on
Report on
BISY 1003/MBIS4003 Assessment 3 PART A
Submitted by:
Name:
Student ID:
Course Code: BISY1003/MBIS4003
Foundation of Programming
Bachelor/Master of Business Information System
Submitted to:
Dr. Md Rafiqul Islam
Senior Lecturer
Business Information Systems
Date of Submission:
Australian Institute of Higher Education
Question 1.1: What will be the outcome of using infinite loop in calculating 10% sales commission of salespersons? Where 1st sale is 298000, 2nd sale is 450000, 3rd sales 980000.
Answer: In programming, loops are used to repeat a block of code. For example, if we want to show a message100times, then we can use a loop. There are two types of loops in Python:
for loopwhile loopSolution:
Outcome:
Description: Here the use of while loop in calculating commission from sales has been presented. Meanwhile, infinite loops has been used under while loops. All the sales amounts from the question have been used as the input. Firstly, I wrote the code for the output and as per coding the sales and commission have been appeared infinite times, even though we can run it in infinite times, I only presented it for three times only.
One problem of while infinite loop is, it does not stop until the program is interrupted the input will continue to come. When I will stop the code then it will only stop.
Interpretation: This code helps us to get the results of as many as salesperson commission we want to calculate. So, it is a positive side of this code, however, it is in hand of user to stop the code or not.