Coding Challenges - IITBx
Coding Challenges - IITBx
4 Take a number as an input, print if the number is odd or even 9 Odd one out
2004 Yay!!! One extra day to live your life.
5 Take the year as an input, print on the screen if it is a Leap year 2007 Get paid for the whole month while working for 28 days only :-)
3 Infants: Soo Cute
45 Others: Damnn!!!!!
Take the age of the user as input, print if the user is an infant (Age 0-5) or teenager
6 (Age 13-19), a senior citizen (>60), or Others 67 Senior Citizen: Earn extra interest on fixed deposits
Write a program to create a basic calculator.
Provide a menu with 4 options to the user and let the user choose one of the options[1-
4].
After the user has chosen the option take 2 more numbers as input from the user.
Perform the operation that user has chosen in first step.
1. Add
2. Subtract 1
3. Multiply 7
7 4. Divide 8 15
Take the price of an item as input from the user. Also take input the rate of GST on the 100
8 item. print the final price of the item by adding GST amount to the price. 15 115
5 Positive
0 Zero
a English e.g.
11 Write a program to check whether a character is a letter of English alphabet or not. 5 Not English char sampleChar = 'a';
e Vowel
12 Write a program to input any letter and check whether it is a vowel or consonant. m Consonant
d
English
&
Special Character
Write a program to input any character and check whether it is an English letter, digit or 5
13 special character. Digit
a Lower Case
14 Write a program to check if a user input character is upper case of lower case letter D Upper Case
Take code price and selling price of an item as input. Write a program to calculate profit
15 or loss.
4 Thursday
Write a program to input week number and print week day (Week starts on Monday and
16 ends on Sunday). 7 Sunday
17 Write a program to input month number and print number of days in that month. 5 31
30
60 It is a triangle
90
20
40 It is not a triangle
18 Write a program to input angles of a triangle and check whether triangle is valid or not. 60
3
3 equilateral
3
3
3 isosceles
6
4
Write a program to check whether the triangle is equilateral, isosceles or scalene 5 scalene
19 triangle. 6
Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer.
Calculate percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
20 Percentage < 40% : Grade F
Write a program to input basic salary of an employee and calculate its Gross salary
according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
21 Basic Salary > 20000 : HRA = 30%, DA = 95%
Write a program to input electricity unit charges and calculate total electricity bill
according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
22 An additional surcharge of 20% is added to the bill
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50