- 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.
- 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.
- 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 dividing30
by100
and multiplying withx
.