Master of Information Systems
Assessment 1: Portfolio 4 (Session 5: Repetition Structure)
Semester 2: Block 8-2026
Course Code: MBIS4003
Course Title: Software Development
Total Marks: 5
Duration: 60 Minutes
This portfolio assessment focuses on repetition structures in Python programming. Students are required to develop Python programs that utilize loops to solve practical problems related to employee bonuses, quantity discounts, and commission calculations. The assessment evaluates understanding of control flow, user input, and conditional logic within iterative structures.
Learning Outcomes
- Demonstrate proficiency in using repetition structures such as for and while loops.
- Apply conditional statements within loops to compute values based on user input.
- Format output effectively to display calculated results.
Task 1 (1.5 Marks)
In an organization, bonuses are provided to employees to encourage their work skills. An overall bonus of 40% of the salary is given for those employees who complete the weekly tasks in less than 3 days and extra work hours of 5 hours. However, a bonus of 15% is given for employees taking time more than three days but less than 5 or has at least an extra work hour of 8 hours and in all other cases there will be no bonus. Write a Python program that will accept the number of days and work hours from a user and will display the bonus the person is eligible for.
Task 2 (1.5 Marks)
A software company sells a package that retails for 129 dollars. Quantity discounts are given according to the following table:
| Quantity | Discount |
|---|---|
| 12-24 | 10% |
| 25-34 | 20% |
| 35-49 | 30% |
| 50 or more | 40% |
Write a program that asks the user to enter the quantity of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. 0.5 marks will be awarded for formatted output.
Task 3 (2.0 Marks)
Write a Python program that asks the user the sales amount and the commission rate and the program displays the commission accrued and the program keeps on asking the user this data as long they want to continue testing. Should this require a for loop or a while loop?
Submission Requirements
- Submit Python code files for each task, named as Task1.py, Task2.py, Task3.py.
- Include comments in the code explaining the logic.
- Ensure the programs handle invalid inputs gracefully.
- Word count: Not applicable (code-based); include a brief explanation document of 300-500 words discussing loop choices.
Grading Rubric
| Criteria | Marks | Description |
|---|---|---|
| Correct implementation of logic | 3.0 | Programs run without errors and produce correct outputs. |
| Code readability and comments | 1.0 | Clear structure, indentation, and explanatory comments. |
| Formatted output and input handling | 1.0 | Proper formatting and error handling. |
Sample Answer Content: To calculate the bonus, first input the salary, days, and extra hours. Use if-elif-else to check conditions: if days < 3 and hours >= 5, bonus = 0.4 * salary; elif (days >= 3 and days < 5) or hours >= 8, bonus = 0.15 * salary; else bonus = 0. As noted in Gaddis (2020), conditional structures ensure accurate computations in payroll systems. The program then displays the bonus amount.
Master of Information Systems
Assessment 1: Portfolio 5 (Session 6: Dictionaries and Sets)
Semester 2: Block 8-2026
Course Code: MBIS4003
Course Title: Software Development
Total Marks: 5
Duration: 60 Minutes
This portfolio assessment emphasizes dictionaries and sets in Python. Students will manipulate dictionary structures to handle data related to mobiles and vehicles, including adding/removing elements, looping, and computing totals. The tasks assess skills in data organization and functional programming.
Learning Outcomes
- Manipulate dictionaries by adding, removing, and updating key-value pairs.
- Use loops to iterate over dictionaries and compute aggregated values.
- Define functions to process dictionary data with conditions.
Task 1 (1 Mark)
For a given dictionary named Mobiles:
Mobiles = {
‘Brand’: [‘Nokia’,’Samsung’,’Motorola’,’Oppo’],
‘Price’: [24000,34000,32000,28000]
}
- Add a key to the above dictionary called ‘colour’.
- Set the colour values to be a list of strings: ’Ivory’,’Black’,’Red’,’White’
- Remove the value 34000 from the list of items stored under Price key. Add a key Series with the value ‘UB40’ under the Series key.
Task 2 (2 Marks)
Create the following two dictionaries Vehicles and Stock for a factory:
Vehicles_Price={‘Skoda’: 150000,’Honda’:180000,’Suzuki’:260000,’Alto’:720000}
Stock={‘Skoda’: 10,’Honda’:12,’Suzuki’:6,’Alto’:20}
Loop through each key in vehicles_Price. For each key, print the key along with its price and stock information. Print the Answer in the following format:
Skoda
Vehicles_Price : 150000
Stock: 10
Calculate the total price value if the factory sold all its vehicles. Create a variable total and set it to zero. Loop through the Vehicles_prices dictionary. For each key in prices, multiply the price by the number in stock. Print that value in the console and add it to the total. Outside the loop the total price may be printed.
Task 3 (2 Marks)
For the two dictionaries (Vehicles_Price and Stock in the previous example, make a list called Purchase_list with the values “ “Skoda”,”Honda”,”Suzuki” and “Alto”. Define a function compute_bill that takes one argument food as input. In the function, create a variable total with an initial value of zero. While you loop through each item of food, only add the price of the item to total if the item’s stock count is greater than zero. If the item is in stock and after you add the price to the total, subtract one from the item’s stock count.
Submission Requirements
- Submit Python code files for each task, named as Task1.py, Task2.py, Task3.py.
- Include comments in the code explaining the logic.
- Ensure the programs handle edge cases, such as empty lists or zero stock.
- Word count: Not applicable (code-based); include a brief explanation document of 300-500 words discussing dictionary advantages over lists.
Grading Rubric
| Criteria | Marks | Description |
|---|---|---|
| Correct dictionary manipulation | 3.0 | Accurate addition, removal, and updates. |
| Looping and calculations | 1.0 | Proper iteration and total computations. |
| Function definition and conditions | 1.0 | Functional code with stock checks. |
Start with the Mobiles dictionary. Add ‘colour’: [‘Ivory’, ‘Black’, ‘Red’, ‘White’] using assignment. Remove 34000 from ‘Price’ with list.remove(34000). Add ‘Series’: ‘UB40’. For vehicles, loop over keys and print formatted info. Compute total by summing price * stock for each. In compute_bill, initialize total=0, loop over food, if stock > 0 add price and decrement stock. As per Lutz (2013), dictionaries enable efficient lookups for inventory management.
References
- Gaddis, T. (2020) Starting out with Python. 5th edn. Pearson. Available at: https://doi.org/10.5555/3667840.
- Lutz, M. (2013) Learning Python. 5th edn. O’Reilly Media. Available at: https://www.oreilly.com/library/view/learning-python-5th/9781449355722/.
- Sweigart, A. (2019) Automate the boring stuff with Python. 2nd edn. No Starch Press. Available at: https://nostarch.com/automatestuff2.
- Hetland, M.L. (2017) Beginning Python: from novice to professional. 3rd edn. Apress. Available at: https://doi.org/10.1007/978-1-4842-0028-5.
- Romano, F. (2019) Learn Python programming. 2nd edn. Packt Publishing. Available at: https://www.packtpub.com/product/learn-python-programming-second-edition/9781788996662.
Key Guarantees
- ✓ Plagiarism-Free
- ✓ On-Time Delivery
- ✓ Student-Based Prices
- ✓ Human Written Papers