Day 1
Day 1
Q1) Determine whether the given year is leap year or not (Read the input
through console).
Q2)
Tax slabs for general
0 to 1,80,000 No tax
1,80,001 to 5,00,000 10%
5,00,001 to 8,00,000 20%
Above 8,00,000 30%
Q3) A shopkeeper sells three products whose retail prices are as follows:
Write an application that reads a series of pairs of numbers as follows:
Product No Product Code Retail Price
1 A 22.50
2 B 44.50
3 C 9.98
a) Product number or code (Code is not case sensitive)
b) Quantity sold
The application should use a switch statement to determine the retail
price for each product. It should calculate and display the total retail
value of all products sold.
Q4) Consider user has N eggs. Then display the no of eggs in gross (144
eggs make one gross) and no of eggs in dozen (12 eggs make one dozen)
and the no of eggs that is left out remaining. The total no of eggs can be
got as input through console. The program should display how many
gross, how many dozen, and how many left over eggs the user has.
For example, if the input is 1342 eggs, then the program should respond
with
• Your number of eggs is 9 gross, 3 dozen, and 10
Q6) Generate a random number between 1 and 100 and display the floor
value and ceil value of the same.
e.g. floor(534.2) = 534
ceil(-23.78)= -23
Q7) Display the cube roots of the list of prime numbers till 100.