If the details of a car are provided in the below format:
Key | Value |
---|
name | Tata Nexon |
manufacturer | Tata |
countryOfOrigin | India |
colour | blue |
supportElectricOption | true |
Write code that takes in these car details to perform the following actions:
- Print the following welcome message to the console only if the car is Electric:
Electric cars are the future! The car we are presenting now is called [Name Here].
- If the car manufacturer's origin is in India:
This car is made in India.
- If not:
The country of origin is [Name of the country].
- If the car's colour is black:
The car's colour is metallic black.
- If it is white:
The car's colour is snow blush.
- If it is neither black nor white:
This car is [colour of the car].
Make sure your code is flexible enough to work with any value of the carDetails
variable that meets these requirements.