Hi, Guest [ Already a member ? Login ]    [ New User Registration! ]
Thursday 09th February 2012
CBSE | IGNOU | NIOS | Find Friends
ICSE Tutor Links
Submit Your Paper

ICSE Papers

ICSE Guess > ICSE Papers > Important Questions > Class X > 2009 > Computer Application > Computer Applicatino By Mr. Vinod Khare

Test Paper – I (based on switch –case and if – else statement)

Q. 1. WAP for following specification:
Class – employee
Data members:
Name , basic salary, da, hra, ta, pf, gross salary
Members methods:
void get() : to accept name and basic salary of employee.
void calc(): to calculate the gross salary based on following slab:


Basic salary

da%

ta%

pf%

>=20,000

53

12

8

>=10,000-<20,000

45

15

8

<10,000

50

10

7

void display(): to display the following data in given format:


Name

Basic Salary

Gross Salary

XXX

XXX

XXX

Now write a main method to create the object of the above class and call the above method to calculate and print the gross salary of an employee.

Q. 2. Write the output of following statements:

switch(num)
{
case 5: num++; System.out.println(num);
case 6:  System.out.println(“SIX”);
case 7: System.out.println(num);
case 0: num++; System.out.println(“ZERO”+num); break;
case -1: num++; num*=2; System.out.println(num);
default :System.out.println(“Case is not matching”); }

  1. assume num as -1 
  2. assume num as 6

Q. 3. Differentiate between:

switch and if-else

Q. 4. A taximeter follows the following method of billing:

Rs. 20 for the first kilometers,
Rs. 10 per km for next 5 kilometers,
Rs. 12 per km for next 10 kilometers,
Rs. 15 per km for above 16 kilometers. WAP to generate the bill of customer.                                                                                                                                         

Q. 5.Write the equivalent switch case statement for the following decision making situation.    

If(x==’1’ || x==’3’)
a=1;
if(x==’5’) a=2;
if(x==’7’) a=3
else a=10;

Q. 6. WAp to compute the railway fare depending on the criteria as given

Age (in years)

Distance (in kms)

Fare (in Rupees)

Below 10

Below 10
Between 10 and 50
Above 50

Rs. 5
Rs. 20
Rs. 50

Between 10 and 60

Below 10
Between 10 and 50
Above 50

Rs. 10
Rs. 40
Rs. 80

Above 60

Below 10
Between 10 and 50
Above 50

Rs. 4
Rs. 15
Rs. 35

 

Test Paper – I (based on switch –case and if – else statement)

Q. 1. Write a java class to calculate the income tax by taking monthly salary of an employee based on the following conditions:

Annual Income (Rs)                                Tax
Up to 130000                                         No tax
Between 130000 – 200000                     15% of the amount exceeding over Rs.130000
From 200000 – 250000                          Rs. 5000 + 20% of the amount exceeding over Rs.  
2000000
Above  250000                                        30% of the amount exceeding Rs.250000

Q. 2. Write a java class to calculate and print the electricity bill to be paid by a customer. Assume that the customer pays a rent of  Rs. 250.00 .

No. of units                                        Charge per unit
Upto 100 units                                       Rs. 1.50
For the next 100 units                           Rs. 2.00
For next 50 units                                   Rs. 2.50
Beyond 250 units                                   Rs. 4.00

Q. 3. Digital World announces seasonal discount on the laptops in the given order.

Cost of the laptop                      Discount
Rs.20,000 -  Rs.30,000                       10%
Rs.30,000 – Rs.40,000                       15%
Rs.40,000 – Rs.50,000                       18%
> = Rs.50,000                                    20%
An additional discount of   5% on all types of laptops is given. Sales tax is calculated at 12% on the price after the discounts. Define a class to accept the cost of the laptop and print the amount payable by the customer on purchase.

Q. 4. Define a class salary described as below:

Data members: name, Address, Phone, Subject Specialization, Monthly Salary, Income Tax
Member methods:

  1. To accept the details of a teacher including the monthly salary
  2. To display the details of the teacher.
  3. To compute the annual Income Tax as 5% of the annual salary above Rs. 1,75,000/-

Write a main method to create object of a class and call the above member method.

Q. 5. Write a menu driven program for following menu:

  • Volume of a cylinder (P r2 h)
  • Volume of cuboid ( l * b* h)
  • Volume of cube (side3)

Q. 6. Write a program for following specification:

Class name – student
Data members :
Name , Hindi marks, English marks, maths marks, computer marks, average, grade.
Member methods:
Student( ) : constructor to initialize data members.
void accept( ) : to accept name and marks in 3 subjects given.
void calcavg( ): to calculate and store the grade according to following slab:
Average marks                          Grade
>=90                                        A++
>=75 - <90                               A
>=60 – 75                                B
<60                                         C

now write the main method to create the object of the class and call the above method.

 

Test Paper – I (based on switch –case and if – else statement)

Q. 13. Define a class salary described as below:-


 Data Members:

 Name, Address, Phone, Subject Specialization, Monthly

 

 Salary, Income Tax.

 Member methods:

(i) To accept the details of a teacher including the monthly

                                

 salary.

                                 

(ii) To display the details of the teacher.

                                

(iii) To compute the annual Income Tax as 5% of the annual  

 

Salary above Rs.1,75,000/-.

Write a main method to create object of a class and call the above member method.

Q. 14. A cloth showroom has announced the following festival discounts on the purchase of items, based on the total cost of the items purchased:- Total cost Discount (in Percentage)


 Total cost

 Discount (in Percentage)

 Less than Rs. 2000

 5%

 Rs. 2001 to Rs. 5000

   25%

 Rs. 5001 to Rs. l0000

   35%

 Above Rs. 10000

   50%

Write a program to input the total cost and to compute and display the amount to be paid by the customer after availing the discount.

Q. 15. Write a program that outputs the results of the following evaluations based on the number entered by the user.

  1. Natural logarithm of the number
  2. Absolute value of the number
  3. Square root of the number
  4. Random numbers between 0 and 1.

Q16.Write a program using a function called area() to compute the area of a :

  1. circle(π* r2) where π = 3.14
  2. square (side*side)
  3. Rectangle (length*breadth)
    Display the menu to output the area as per User's choice.

Q. 17. Write the syntax of switc-case statements.

Q. 18. Define fall through in reference of switc-case statement.

VXL TUTORIALS
by VINOD KHARE(Vicky Sir)
K- BLOCK (behind Radha Madhav Mandir) 9336061496

 

About Us - Guest Book - Education Forum - Contact Us - Help - Links - Advertise With Us - Terms of Service - Privacy Policy

© 2003-2012, ICSEGuess.com

Developed By Dreamzsop