. 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.
Answer Posted / 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 View All Answers
What are operators in c?
What is #ifdef ? What is its application?
What is a file descriptor in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Using which language Test cases are added in .ptu file of RTRT unit testing???
Do you know the use of fflush() function?
What is structure padding in c?
What is the importance of c in your views?
What is memcpy() function?
Are there constructors in c?
How do I use strcmp?
What is a string?
What are qualifiers in c?
What is a pointer in c?
Is printf a keyword?