mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: fixed first person language in discount calculator workshop (#67426)
Signed-off-by: Lakshminarasimhan <137640490+narasimhan-lakshmi@users.noreply.github.com> Co-authored-by: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a2e0622ccb
commit
cdb7c75332
+1
-1
@@ -7,7 +7,7 @@ dashedName: step-19
|
||||
|
||||
# --description--
|
||||
|
||||
Let's test your new discount strategy. After the existing code, create an instance of `FixedAmountDiscount` with an amount of `5` and assign it to a variable named `fixed_discount`. Then apply this discount to the product and print the result.
|
||||
You can now test the new discount strategy. After the existing code, create an instance of `FixedAmountDiscount` with an amount of `5` and assign it to a variable named `fixed_discount`. Then apply this discount to the product and print the result.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ dashedName: step-20
|
||||
|
||||
# --description--
|
||||
|
||||
Now let's create a third discount strategy for premium users. Create a class named `PremiumUserDiscount` that inherits from `DiscountStrategy`.
|
||||
For the third discount strategy, create a class named `PremiumUserDiscount` that inherits from `DiscountStrategy`.
|
||||
|
||||
Unlike the previous strategies, this one doesn't need an `__init__` method because it doesn't store any configuration. It will apply a fixed 20% discount to all premium users.
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ dashedName: step-29
|
||||
|
||||
# --description--
|
||||
|
||||
Now let's test the complete discount system! Add an `if` statement checking if `__name__ == '__main__'` and move `product = Product('Wireless Mouse', 50.0)` inside it.
|
||||
It's time to test the complete discount system! Add an `if` statement checking if `__name__ == '__main__'` and move `product = Product('Wireless Mouse', 50.0)` inside it.
|
||||
|
||||
After that, inside the `if` block, create a variable `user_tier` and set it to the string `Premium`. Then create a variable `strategies` set to a list of strategies containing `PercentageDiscount(10)`, `FixedAmountDiscount(5)`, and `PremiumUserDiscount()`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user