Skip to main content

PRACTICE QUESTIONS SET 1

LIST OF PROGRAMS


1.         WAP to in put an age of a person and check where he is an adult or not    
2.         WAP to check whether a number is odd or even 
3.         WAP to check weather a number is divisible by 8 or not  
4          WAP to check whether numerator and denominator and check it is divisible or not.  
5.         WAP to check whether a number is positive or not. 
6.         WAP to check a Year leap year or not.  
7.         WAP to check a character is vowel or not.  
8.         WAP to calculate the commission at the end of the month for a company, which gives a 10% commission to its salesman if their monthly sales amount is Rs 10,000 or more. 
9.         ABC Company gives a 5% commission to its salesman if their monthly sales are less than Rs. 10,000 and a10% commission if is equal to or greater than Rs. 1 0,000 Calculate the commission at the end of the month.
10.       XYZ Company gives allowances to its employees depending on their grade as follows.

Grade
Allowances
A                   
300
B                    
250
Others            
100        

Calculate the Salary at the end of the month

11.       The company plans to give a year –end 5% bonus to each of its employees, However if an employee has beenworking for 10 or more years at the company he has to get an additional Rs. 500, lets calculate the bonus for any given employee 
12.       Montauk Company has decided to make their commission structure more aggressive for their sales department as follows.

Sales
Grade
Commission
10,000
1
10%

2
8%
<=10,000
--
5%

13.       WAP to calculate the fare for a railway journey depending on the following conditions.

Age
Distance [ in Kms ]
Fare
Below 10
Below 50
5

51 -100
10

Above 100
15
11-50
Below 50
10

51-100
15

Above 100
20
Above50
Below 50
15

51-100
20

Above100
25

14.       WAP to initialize the Name of Student and his Average Marks and the assign him a grade as per the following rules
a.         AvgMarks  >=90 then grade is A+
b.         AvgMarks >=80 and <90 then grade is A
c.         AvgMarks >=70 and <80 thengrade is B+ 
d.         AvgMarks >=and <70 then grade is B
            e.         Avg Marks >=50 and <60 then grade is C
            f.          AvgMarks <50 then FALL

15.       WAP to find the roots of a quadratic equation given by ax2 + bx + c =0 If              b2- 4ac > 0 then print the roots are real and unequal
Rootl = **********    Root2 =        *************
2a        2a        v If b - 4ac = 0 then print the, roots are real and equal.
Root= — la
If b2- 4ac < 0 then print the roots are complex and imaginary.

16.       The rates of income tax applicable on income of the individuals for the assessment year 2003-2004 were as follows.

Net income Range
Rates of Income Tax
Up to Rs 50000
Nil
Above Rs. 50000 but up to Rs. 60000.
10% of the amount by which the                                                                                                                                                                                              total income  exceeds Rs. 50000
Above Rs. 60000 but up to Rs 150000.
Rs. 1000 plus 20% of the amount by which the total income exceeds Rs. 6 thousand
Above Rs. 150000
Rs. 19000 plus 30% of the amount by which the total income exceeds Rs. 150000.
17.       In Order to force consumers to consume less water at their homes ,the corporation adopts a set of conservative annual water tax rules based upon the water consumption of the consumer The criteria and tax are as follows

Water Consumed   [in gallons]
Tax Rate
Up to 50
NIL
More than 50 but less than100
500
More than 100 but less than 200
800
More than 200 but less than 300
1100
More than 300
1700

18.       A bicycle shop hires a bicycle on a daily basis at different rates throughout the year the following table illustrates how the hire charges vary through the year.

Season
Daily Charges [in Rs.]
Spring
4.00
Summer
7.00
Autumn
3.00
Winter
2.00

The proprietor also gives a discount on the number of days the bicycle is hired for. If the bicycle are hired for more than 10days .than a discount of 30% is given on the total charge  Further for every bicycle hired a security deposit of Rs.100 must be paid WAP to initialize the season and the number of days the bicycle is hired for and output the hire charge including the deposit .
19.       A student appears for a test in 3 subjects. Each test is out of 100 marks. The percentage of each student has to be calculated and depending on the percentage calculated, grades are given as under.

Percentage
Grade
>=90
A+
80-89
A
70-79
B+
60-69
B
50-59
C+
<50
Fail
                                  



20.       Universal, a stationary store gives discounts to its customers.  The store gives two types of discounts namely quantity and cash discounts. The quantity discount is given depending on the quantity bought as shown in the table given below. A cash discount of 5% is given only to customers who make an early payment, which is within three days of the delivery of the order.

Qty
Discount
<5
0%
>=5 but <25
5%
>=25 but <50
10%
>=50 but <100
15%
>100
20%

Comments

Popular posts from this blog

unix commands