100% satisfaction guarantee Immediately available after payment Read online or as PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

COS1512 ASSIGNMENT 2 1st SEMESTER 2024.

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
21-06-2024
Written in
2023/2024

COS1512 ASSIGNMENT 2 1st SEMESTER 2024. Due: Friday, 12 July 2024, 12:00 PM. YEAR MODULE 2024 PASS WITH DISTINCTIONS-FORTIS PASSUM.

Institution
Course

Content preview

COS1512 ASSIGNMENT 2


Due: Friday, 12 July 2024, 12:00 PM


YEAR MODULE 2024



PASS WITH DISTINCTIONS. FORTIS PASSUM


FOR FURTHER ASSISTANCE WITH ECONOMICS,
MANAGEMENT, ACCOUNTING, TAXATION EDUCATION@ LLB
MODULES.


CALL/WHATSAAP0816884518/0816884519
EMAIL:


, Question 1
def calcPostage(weight: float, zone: int) -> float:
# Constants for GlobalMail
COST_PER_KG_ZONE_1_TO_3 = 108
COST_PER_KG_ZONE_4_TO_6 = 130


if 1 <= zone <= 3:
return weight * COST_PER_KG_ZONE_1_TO_3
elif 4 <= zone <= 6:
return weight * COST_PER_KG_ZONE_4_TO_6
else:
raise ValueError("Invalid zone. Zone must be between 1 and 6.")


def calcPostage(weight: float, length: float, width: float, height: float) -> float:
# Constants for DHL
COST_PER_KG_DHL = 70
VOLUMETRIC_DIVISOR = 5000


volumetric_weight = (length * width * height) / VOLUMETRIC_DIVISOR
chargeable_weight = max(weight, volumetric_weight)


return chargeable_weight * COST_PER_KG_DHL


def main():
courier_choice = input("Enter 'g' for GlobalMail or 'd' for DHL: ").lower()


if courier_choice == 'g':
weight = float(input("Enter the weight of the parcel (kg): "))
zone = int(input("Enter the zone (1 to 6): "))

Written for

Institution
Course

Document information

Uploaded on
June 21, 2024
Number of pages
8
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
distinctiongateway Gateway To Distinctions
Follow You need to be logged in order to follow users or courses
Sold
253
Member since
2 year
Number of followers
114
Documents
102
Last sold
3 weeks ago
Gateway to Distinctions

4.4

30 reviews

5
19
4
6
3
3
2
2
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions