It would not be hot news for you to hear that throughout your everyday life, whatever you do, you are having an impact on the environment. Words like pollution, global warming, carbon dioxide, recycling, energy saving, waste reduction are no mystery to you.
For this challenge you are going to design a quiz that people can take to find out how green or eco-friendly they are. The quiz will consist of eight questions and will be used to give the end-user a score.
Here are the eight questions for the quiz.
- How do you come to school?
- By Car (-50pts)
- By Bus (-10pts)
- On Foot (+100pts)
- Cycling (+100pts)
- Did you travel by plane in the last 12 months?
- No (+100pts)
- Yes once (-25pts)
- Yes twice (-50pts)
- At least 3 times (-100pts)
- Do you use your recycling bins at home?
- Never (-50pts)
- Rarely (+10pts)
- Often (+50pts)
- Yes every day (+100pts)
- When you go shopping do you?
- Bring your own reusable carrier bags (+20pts)
- Ask for plastic bags (-20pts)
- At home do you use Energy saving bulbs?
- Yes (+30pts)
- No (-30pts)
- When you clean your teeth, do you let the water run?
- Yes (-30pts)
- Sometimes (-10pts)
- No, never (+20pts)
- Is your house equipped with solar panels?
- Yes (+100pts)
- No (0pt)
- When it’s getting a bit colder at the end of the summer do you?
- Put an extra layer on (e.g. jumper, extra blanket) (+50pts)
- Turn the heater on? (-50pts)
At the end of the quiz, the user will be told what is their score and what category they belong to amongst these four categories:
Score | Category |
Negative score (<0) | Amber |
Between 0 and 100 | Light Green |
Between 101 and 200 | Emerald Green |
Above 200 | Deep Green |
Let’s get coding
We have started the code for you but only completed the first question. Your task consists of:
- Completing the code to ask all seven questions,
- Giving the user their final score and the category they belong to (Amber, Light Green, Emerald Green or Deep Green) based on their final score.
Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area