Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.96 KB

File metadata and controls

25 lines (18 loc) · 1.96 KB

Hints

1. Determine if you will need a drivers licence

  • Use the strict equals operator to check whether your input equals a certain string.
  • Use one of the two logical operators you learned about in the boolean concept to combine the two requirements.
  • You do not need an if-statement to solve this task. You can return the boolean expression you build directly.

2. Choose between two potential vehicles to buy

  • Use a relational operator to determine which option comes first in dictionary order.
  • Then set the value of a helper variable depending on the outcome of that comparison with the help of an if-else statement.
  • Finally, construct the recommendation sentence. For that, you can use the addition operator to concatenate the two strings.

3. Calculate an estimation for the price of a used vehicle

  • Start with determining the percentage based on the age of the vehicle. Save it in a helper variable. Use an if-else if-else statement as mentioned in the instructions.
  • In the two if conditions, use relational operators to compare the car's age to the threshold values.
  • To calculate the result, apply the percentage to the original price. For example, 30% of x can be calculated by dividing 30 by 100 and multiplying with x.