Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 2.3 KB

task.md

File metadata and controls

53 lines (37 loc) · 2.3 KB

Tasks

Please complete the following tasks and post them on the tapaScript Discord under "40 Days of JavaScript".

DO NOT USE AI to FIND ANSWERS. If you are stuck, let's discuss it on DISCORD and learn. Also, please note that none of the answers need you to create any UI. Just focus on the logic building and print the output on the browser console.

1. Odd or Even?

  • Take a number and find if the number is an odd or even number.
  • Print the number and result in the console.

2. Do you have a Driving License?

Let's check if you are eligible to get a driving license. The eligibility to get a driving licence is 18 years.

  • Manage age as a variable.
  • Check if the age is elligible for a driving license and print it on the console accordingly.

3. Calculate CTC with a Bonus

Let's calculate how much you earn from your office.

  • You get 12,300 rupees as your monthly salary.
  • You get a 20% bonus on your annual salary.
  • How much money do you make per annum as a CTC?

4. Write a program for the Traffic Light Simulation.

Red Light... Green Light... Let's Play!

  • Create a color variable.
  • Based on the color variable's value print in the console if a traveller needs to STOP or GO. The Red color is for STOP and the Green color is for GO.

5. Create an Electricity Bill Calculator

Let's calculate how much you pay for electricity bills per month and annually.

  • Create a units variable. Based on this value you will calculate the total electricity bill for a months.
  • If each day you consume the units and each unit cost 150 rupees, how much will you be charged per month?
  • If there is a 20% discount on the annual payment, how much will you be charged for an annual payment?

6. Leap Year Checker

Is 2025 a Leap Year?

  • Take year as input.
  • Use the arithmetic operator and ternary operator to print if a year is a leap year or not.

7. Max of Three Numbers

Find the max number from the lot.

  • Take three numbers and assign them to variables p, q, and r.
  • Now find the maximum of these three numbers using the comparison operators.

8. Bitwise Doubling

A tricky one for you

  • Create a variable count and assign a value, say, 5.
  • Now use the Bitwise shift operator to make the number double.
  • Print it on the console.