CSD201_-_PE_-_D2_3486.webp
Minthep

CSD201_-_PE_-_D2_3486.webp

  • Media owner Minthep
  • Ngày thêm
Bài viết gốc: Chủ đề 'CSD201 - PE - D2'
Zoom
Kizspy.me
- FUO
(Chair, 7, 1, 0)
Truck Contents: (Pot, 10, 1, 1) (Bed, 100, 2, 0)
ItemList Inventory: (Stove, 10, 2, 0) (Table, 80, 3, 0) (Sofa, 50, 2, 0) (TV, 20, 1, 1) (Chair, 7, 1, 0)
Truck Contents: (Lamp, 5, 1, 1) (Pot, 10, 1, 1) (Bed, 100, 2, 0)
c. f3(): 2.5 marks - Load all fragile items onto the truck
To complete the requirement f3(), students need to:
1. Remove all fragile items from the list.
2. Then push each removed item into the truck in the same order as they removed in the
original list.
The expected output used to test your code are as follows:
ItemList Inventory: (Stove, 10, 2, 0) (Lamp, 5, 1, 1) (Table, 80, 3, 0) (Sofa, 50, 2, 0) (TV, 20, 1, 1)
(Chair, 7, 1, 0)
Truck Contents: (Pot, 10, 1, 1) (Bed, 100, 2, 0)
ItemList Inventory: (Stove, 10, 2, 0) (Table, 80, 3, 0) (Sofa, 50, 2, 0) (Chair, 7, 1, 0)
Truck Contents: (TV, 20, 1, 1) (Lamp, 5, 1, 1) (Pot, 10, 1, 1) (Bed, 100, 2, 0)
d. f4(): 2.5 marks - Compute total weight of items on the truck
To complete the requirement f4(), students need to:
1. Remove all fragile items from the list. (as f3)
2. Push each removed item into the truck in the same order as they appeared in the
original list. (as f3)
3. Compute and return the total weight of all items in the truck.
The expected output used to test your code are as follows:
ItemList Inventory: (Stove, 10, 2, 0) (Lamp, 5, 1, 1) (Table, 80, 3, 0) (Sofa, 50, 2, 0) (TV, 20, 1, 1)
(Chair, 7, 1, 0)
+100%
Close
Chưa có bình luận nào.

Thông tin

Category
CSD201
Thêm bởi
Minthep
Ngày thêm
Lượt xem
3,205
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom