. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.



. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program t..

Answer / ibtu

Private Sub Form_Load()
02 rs.data source=" & App.Path & "PERSON.mdb"
03 rs.RecordSource = "select * from PERSON"

Dim CountEmp as Integer
CountEmp=0;
rs.MoveFirst
For i = 1 To rs.RecordCount ' Read all the records from database


Name = rs("NAME")
Basic = rs("BASIC")
HRA = rs("HRA")
TotalSal=Basic + Hra ‘Calculate the total salary


If TotalSal> 10000 Then
DISPLAY Name,Basic,Hra,TotalSal ‘Display employee
CountEmp=CountEmp+1  ‘Count the employees with sal >10000
End If

rs.MoveNext
Next i


DISPLAY “No of Employees”,CountEmp
End Sub

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More C Interview Questions

different between overloading and overriding

3 Answers  


Explain the difference between struct and union.

2 Answers  


How the C program can be compiled?

11 Answers   HP,


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

0 Answers  


what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }

3 Answers  


How to use c/c++ code in JAVA

10 Answers   CDAC, IBM, Satyam, Scope International,


write a c prog for removing duplicate character from an array and sorting remaining elements using a single array

1 Answers  


Explain what a Binary Search Tree is.

3 Answers  


WRITE A PROGRAM TO FIND A REVERSE OF TWO NO

7 Answers  


What is static function in c?

0 Answers  


What is meant by 'bit masking'?

0 Answers  


2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);

9 Answers   HCL, Tech Mahindra,


Categories