0% found this document useful (0 votes)
19 views100 pages

Computer XII Practicals

The document outlines a series of practical programming exercises in C language, each with a specific objective, algorithms, flow charts, and source code. The exercises range from simple tasks like printing statements and performing arithmetic operations to more complex tasks like calculating areas, handling user input, and implementing control structures. Each practical includes a clear structure with steps to follow, ensuring a comprehensive learning experience for programming students.

Uploaded by

cruel.livin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views100 pages

Computer XII Practicals

The document outlines a series of practical programming exercises in C language, each with a specific objective, algorithms, flow charts, and source code. The exercises range from simple tasks like printing statements and performing arithmetic operations to more complex tasks like calculating areas, handling user input, and implementing control structures. Each practical includes a clear structure with steps to follow, ensuring a comprehensive learning experience for programming students.

Uploaded by

cruel.livin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

2024 / 25

C language Practicals
Practical #01
Object:

Write a program that prints a statement using “printf”.

Algorithms:

Step#1: Start.

Step#2: Print a statement.

Step#3: Exit.

Flow Chart:

Start

Print a Statement

Stop
Source Code:

Output:
Practical #02
Object:

Write a program that prints text of four lines consisting of characters,


integer, floating point & character as a string values “printf()”
statements and escape statement.

Algorithms:

Step#1: Start.

Step#2: Initialize char, int, float & char as string.

Step#3: Print char, int, float & string.

Step#4: Exit.
Flow Chart:

Start

Initialize char, int, float & char as string.

Print char, int, float & string.

Stop
Source Code:

Output:
Practical #03
Object:

Write a program that read and prints the char, int, float & character as a
string values and print them on screen “scanf()” , “printf()” & escape
sequence.

Algorithms:

Step#1: Start.

Step#2: Read char, int, float & char as string.

Step#3: Write char, int, float & string.

Step#4: Exit.
Flow Chart:

Start

Read char, int, float & char as string.

Write char, int, float & string.

Stop
Source Code:

Output:
Practical #04
Object:

Write a program that read that read temperature of 6 days and print it
on string.

Algorithms:

Step#1: Start.

Step#2: Read temperature of 6 days (day1,day2,day3,day4,day5,day6).

Step#3: Write temperature of 6 days (day1,day2,day3,day4,day5,day6).

Step#4: Exit.
Flow Chart:

Start

Read temperature of 6 days (day1, day2, day3, day4, day5, day6).

Read temperature of 6 days (day1, day2, day3, day4, day5, day6).

Stop
Source Code:

Output:
Practical #05
Object:

Write a program that convert Fahrenheit to Celsius. (Celsius=5.0/9.0* {


Fahrenheit-32 })

Algorithms:

Step#1: Start.

Step#2: Declare Fahrenheit=18 & Celsius.

Step#3: Set (Celsius=5.0/9.0* { Fahrenheit-32 }).

Step#4: Print Celsius.

Step#5: Exit.
Flow Chart:

Start

Declare Fahrenheit=18 & Celsius.

Set (Celsius=5.0/9.0* { Fahrenheit-32 }).

Print Celsius.

Stop
Source Code:

Output:
Practical #06
Object:

Write a program that find the Area of triangle (Area=1/2*base*height),


Area of Circle(A=pi*r^2) and Volume of Sphere(V=4/3*pi*r^3).

Algorithms:

Step#1: Start.

Step#2: Define float, areaoftriangle, areaofcircle and volumeofsphere .

Step#3: Declare base=10,height=20,r=5,pi=3.142.

Step#4: areaoftriangle=1/2*base*height.

Step#5: areaofcircle= pi*r^2.

Step#6: volumeofsphere=4/3*pi*r^3.

Step#7: Print areaoftriangle, areaofcircle and volumeofsphere.

Step#8: Exit.
Flow Chart:

Start Stop

Print areaoftriangle, areaofcircle and


volumeofsphere.

Define float, areaoftriangle,


areaofcircle and volumeofsphere . volumeofsphere=4/3*pi*r^3.

areaofcircle= pi*r^2.

Declare base=10, height=20, r=5, areaoftriangle=1/2*base*height.


pi=3.142.
Source Code:

Output:
Practical #07
Object:

Write a program that calculates both the positive and negative roots of
the quadratic equation using the above formula.

Algorithms:

Step#1: Start.

Step#2: Define float positive, negative.

Step#3: Declare a = 2, b = 6, c =4.

Step#4: Quadratic Formula: {−b±(b^2−4ac) ^ (1/2)}/2a

Step#5: Print positive, negative.

Step#6: Exit.
Flow Chart:

Start Stop

Define float positive, negative. Print positive, negative.

Declare a = 2, b = 6, c =4. Quadratic Formula: {−b±(b^2−4ac) ^ (1/2)}/


2a
Source Code:

Output:
Practical #08
Object:

Write a program that provide number, its square & its cube.

Algorithms:

Step#1: Start.

Step#2: Define a, b, c.

Step#3: Declare a=6.

Step#4: Set b=pow (a,2); c=pow(a,3);

Step#5: Print b, c.

Step#6: Exit.
Flow Chart:

Start Stop

Define a, b, c. Print b, c.
.

Declare a=6. Set b=pow (a,2); c=pow(a,3);


Source Code:

Output:
Practical #09
Object:

Write a program for addition of three numbers.

Algorithms:

Step#1: Start.

Step#2: Define a, b, c, d.

Step#3: Declare a=18, b=56, c=47.

Step#4: d=a+b+c.

Step#5: Print d.

Step#6: Exit.
Flow Chart:

Start Stop

Define a, b, c, d. Print d.

Declare a=18, d=a+b+c.


b=56, c=47.
Source Code:

Output:
Practical #10
Object:

Write a program that inputs a character and print its equivalent ASCII
number.
Algorithms:

Step#1: Start.

Step#2: Define c.

Step#3: Read c.

Step#4: Write c.

Step#5: Exit.
Flow Chart:

Start

Define c. Stop

Read c. Write c.
Source Code:

Output:
Practical #11
Object:

Write a program that inputs cost of any item and if cost is greater than
40000, special tax is added.
Algorithms:

Step#1: Start.

Step#2: Define long integer cost.

Step#3: Read cost.

Step#4: if(cost>40000).

Step#5: Write “Special Tax is Added”

Step#6: Else write “Special Tax is Added”

Step#7: Exit
Flow Chart:

Stop
Start
Write “Special Tax is
not Added”.

Define long integer


cost. Write “Special Tax is
Added”.

Read cost. if(cost>40000).


Source Code:

Output:
Practical #12
Object:

Write a program that says whether the item is taxable or not if it is


taxable add 6 percent.

Algorithms:

Step#1: Start.

Step#2: Declare variables cost and item as long integers.

Step#3: Display the message "Enter value of item:".

Step#4: Read the value of cost.

Step#5: If cost > 50000, write "Amount is Taxable".

Step#6: Else, write "Amount is Not Taxable".

Step#7: Exit.
Flow Chart:

Stop
Start
Else, write "Amount is
Not Taxable".

Declare variables cost and


item as long integers.
if(cost>50000).

Display the message Read the value of


"Enter value of item:". cost.
Source Code:

Output:
Practical #13
Object:

Write a program that ask income and number of dependent, if number


of dependent are greater than 5 than print “no income tax”.
Algorithms:

Step#1: Start.

Step#2: Define long integers income and no_of_dependent.

Step#3: Write "Enter Number of dependent".

Step#4: Read no_of_dependent.

Step#5: Write "Enter The Income".

Step#6: Read income.

Step#7: If (no_of_dependent > 5) write "No Income Tax".

Step#8: Else write "Income Tax is applicable".

Step#9: Exit.
Flow Chart:

Stop

Else write "Income Tax is


applicable"

Read income.

Read income.
Start if(no_of_dependent>5).

Read income.
Read income.

Define long integers income Read income.


and no_of_dependent. Read"Enter
Write income.
The
Income".
Read income.
Write "Enter Number of Read
dependent". Read income.
no_of_dependent.

Read income.

Read income.
Source Code:

Output:
Practical #14
Object:

Write a program that tell user whether number is positive or negative.


Algorithms:

Step#1: Start.

Step#2: Define integer a

Step#3: Write "Enter Number" and read a

Step#4: If (a > 0)

Step#5: Write "The number is positive"

Step#6: Else write "The number is Negative"

Step#7: Exit.
Flow Chart:

Stop
Start
Else write "The
number is Negative"

Define integer a.
Write "The number is
positive"

Write "Enter Number" If (a > 0)


and read a
Source Code:

Output:
Practical #15
Object:

Write a program that ask the name of student and his percentage than
display as follows;
If (percentage > 80) then “A-1”
If (percentage > 70) then “A”
If (percentage > 60) then “B”
Algorithms:

Step#1: Start.

Step#2: Define character array name[15] and integer percentage

Step#3: Write "Enter Student Name" and read name

Step#4: Write "Enter Student Percentage" and read percentage

Step#5: If percentage > 80 write "A-1 Grade"

Step#6: Else if percentage > 70 write "A Grade"

Step#7: Else if percentage > 70 write "B Grade"

Step#8: Else write "SORRY TRY AGAIN"

Step#9: Exit.
Flow Chart:

Stop

Else write "SORRY TRY


AGAIN"

If (percentage > 60)


write "B Grade"

Start

If (percentage > 70)


Define character array
write "A Grade"
name[15] and integer
percentage

Write "Enter Student


Name" and read name
If (percentage > 80)
write "A-1 Grade"
Write "Enter Student
Percentage" and read
percentage
Source Code:

Output:
Practical #16
Object:

Write a program that uses if else ladder to add, subtract, multiply &
divide two numbers.
Algorithms:

Step#1: Start.

Step#2: Define integers a, b, c, and ch

Step#3: Write the menu options and read ch

Step#4: If ch == 1
Read a and b, calculate c = a + b, write "Answer is = c"

Step#5: Else if ch == 2
Read a and b, calculate c = a - b, write "Answer is = c"

Step#6: Else if ch == 3
Read a and b, calculate c = a * b, write "Answer is = c"

Step#7: Else if ch == 4
Read a and b, calculate c = a / b, write "Answer is = c"

Step#8: Else Write "No operation on this number"

Step#9: Exit
Flow Chart:

Stop

Else Write "No operation on


this number"

If ch == 4
Start

If ch == 3

Define integers a, b, c, and


ch
If ch == 2

Write the menu options If ch == 1


and read ch
Source Code:

Output:
Practical #17
Object:

Write a program that uses number 1,2,3,4 and print the name of that
are you enter.
Algorithms:

Step#1: Start.

Step#2: Define integer a

Step#3: Write "Enter Number for their Name" and read a

Step#4: If a == 1 write "One"

Step#5: If a == 2 write "Two"

Step#6: If a == 3 write "Three"

Step#7: If a == 4 write "Four"

Step#8: Else write "Wrong Number"

Step#9: Exit
Flow Chart:

Stop

Else write "Wrong Number"

If a == 4 write "Four"
Start

If a == 3 write "Three"

Define integer a
If a == 2 write "Two"

Write "Enter Number for If a == 1 write "One"


their Name" and read a
Source Code:

Output:
Practical #18
Object:

Write a program by using switch case statement that categories vowels


and consonants.
Algorithms:

Step#1: Start.

Step#2: Define character ch

Step#3: Write "Enter Alphabet to check its vowel or consonant" and read
ch

Step#4: If ch == 'a', ch == 'e', ch == 'i', ch == 'o', or ch == 'u' write "Vowel"

Step#5: Else write "Consonant"

Step#6: Exit
Source Code:

Output:
Practical #19
Object:

Write a program that Add, Subtract, Multiply and Divide two numbers
using switch case statements.
Algorithms:

Step#1: Start.

Step#2: Define integers a, b, c, and ch

Step#3: Write the menu options and read ch

Step#4: If ch == 1 read a and b, calculate c = a + b, write "Answer is = c"

Step#5: If ch == 2 read a and b, calculate c = a - b, write "Answer is = c"

Step#6: If ch == 3 read a and b, calculate c = a * b, write "Answer is = c"

Step#7: If ch == 4 read a and b, calculate c = a / b, write "Answer is = c"

Step#8: Else write "No operation on this number"

Step#9: Exit
Source Code:

Output:
Practical #20
Object:

Write a program that convert the month number into month name.

Algorithms:

Step#1: Start
.
Step#2: Define integer ch

Step#3: Write "Enter Numbers to Get its Month" and read ch

Step#4: If ch == 1 write "January"

Step#5: If ch == 2 write "February"

Step#6: If ch == 3 write "March"

Step#7: If ch == 4 write "April"

Step#8: If ch == 5 write "May"

Step#9: If ch == 6 write "June"

Step#10: If ch == 7 write "July"

Step#11: If ch == 8 write "August"

Step#12: If ch == 9 write "September"


Step#13: If ch == 10 write "October"

Step#14: If ch == 11 write "November"

Step#15: If ch == 12 write "December"

Step#16: Else write "Wrong Number"

Step#17: Exit
Source Code:

Output:
Practical #21
Object:

Write a program that print the large number among three inputted
numbers.

Algorithms:

Step#1: Start.

Step#2: Define integers x = 10, y = 4, z = 20

Step#3: Write "Enter Numbers to Get its Month" and read ch

Step#4: Write "The Largest Number Among x=10, y=4 & z=20 is:"

Step#5: If x > y and x > z, write "The largest Number is x = x"

Step#6: Else if y > x and y > z, write "The largest Number is y = y"

Step#7: Else write "The largest Number is z = z"

Step#8: Exit
Source Code:

Output:
Practical #22
Object:

Write a program that use for loop to print numbers from 1 to 10.

Algorithms:

Step#1: Start.

Step#2: Initialize i = 1

Step#3: For i = 1 to i <= 10:

Step#4: Print the value of i

Step#5: Increment i by 1

Step#6: Exit
Source Code:

Output:
Practical #23
Object:

Write a program that use while loop to print numbers from 1 to 10.

Algorithms:

Step#1: Start.

Step#2: Initialize i = 1

Step#3: while i <= 10;

Step#4: Print the value of i

Step#5: Increment i by 1

Step#6: Exit
Source Code:

Output:
Practical #24
Object:

Write a program that use do while loop to print numbers from 1 to 10.

Algorithms:

Step#1: Start.

Step#2: Initialize a = 1

Step#3: Print the value of a

Step#4: Increment a by 1

Step#5: while a <= 10;

Step#6: Exit
Source Code:

Output:
Practical #25
Object:

Write a program that display “Pakistan” 10 times.

Algorithms:

Step#1: Start.

Step#2: Initialize i = 1

Step#3: for i <= 10;

Step#4: Increment i by 1

Step#5: Print “Pakistan”

Step#6: Exit
Source Code:

Output:
Practical #26
Object:

Write a program that display even numbers from 0 to 200.

Algorithms:

Step#1: Start.

Step#2: Initialize i = 0

Step#3: For i = 0 to i <= 200

Step#4: increment i by 2

Step#5: Print the value of i

Step#6: Exit
Source Code:

Output:
Practical #27
Object:

Write a program that display odd numbers from 0 to 200.

Algorithms:

Step#1: Start.

Step#2: Initialize i = 1

Step#3: For i = 1 to i <= 200

Step#4: increment i by 2

Step#5: Print the value of i

Step#6: Exit
Source Code:

Output:
Practical #28
Object:

Write a program that prompt user whether the number is even or odd.

Algorithms:

Step#1: Start.

Step#2: Define i

Step#3: Write "Enter Any Number"

Step#4: Read i

Step#5: Check if (i % 2) == 0:

Step#6: If true, write "Number is Even"

Step#7: Else, write "Number is Odd"

Step#8: Exit
Source Code:

Output:
Practical #29
Object:

Write a program that prints 15 number of rows and asterisks.

Algorithms:

Step#1: Start.

Step#2: Define integers i and j

Step#3: For i = 1 to i <= 15:

Step#4: For j = 1 to j <= 15: (Nested loop)

Step#5: Print * with tab spacing

Step#6: Print a newline (\n)

Step#7: Exit
Source Code:

Output:
Practical #30
Object:

Write a program that shows multiplication table from 1 to 10.


Algorithms:

Step#1: Start.

Step#2: Define integers i, a, and b.

Step#3: Write "Enter Number For Its Table" and read a.

Step#4: Set up a loop for i = 1 to i <= 10.

Step#5: Calculate b = a * i.

Step#6: Print the value of a * i = b.

Step#7: Exit
Source Code:

Output:
Practical #31
Object:

Write a program that use do loop to print out the table of ASCII code
from 32 to 127.
Algorithms:

Step#1: Start.

Step#2: Define an integer n = 32.

Step#3: Begin a do-while loop.

Step#4: Print n and its corresponding character using the format n =


character.

Step#5: Increment n by 1.

Step#6: Repeat the loop while n is less than or equal to 127.

Step#7: Exit
Source Code:

Output:
Practical #32
Object:

Write a program that shows following output.


*****
****
***
**
*
Algorithms:

Step#1: Start.

Step#2: Define integers row and col.

Step#3: For row = 1 to row <= 5, repeat the following steps:

Step#4: For col = 1 to col <= row, print *|.

Step#5: After the inner loop, print a newline.

Step#6: End the loops.

Step#7: Exit
Source Code:

Output:
MS access Practicals
Practical #01
Object:

Create a student database having following fields or attributes.


• ID
• Name
• Age
• Gender
• Department

Instructions:
1. Create the student table
2. Insert 10 records.
3. Set student ID as a primary key.
4. Find the list of females.
5. Find the list of CS students.
6. Find the list of all students.

Procedure:
To Create Microsoft Access Database:
1. Click Start > Programs > Microsoft Access.

To Create New Database:


1. Select "Blank Database".
2. Enter File Name.
3. Click "Create".

To Create Student Table:


1. Click "View" > "Table".
2. Enter Table Name (e.g., "Table1").
3. Click "OK".
4. Create fields by entering Field Name and selecting Data Type.
5. Click "Save" and then "Close".
To Input Field:
1. Enter Field Name.
2. Select Data Type.
3. Click "Save".

To Input Records:

To Find The List Of Female By Query Wizard:


1. Open Microsoft Access.
2. Go to "Create" > "Query Wizard."
3. Select "Simple Query Wizard" and click "OK."
4. Choose your table, add the "Name" and "Gender" fields, then click
"Next."
5. Name the query (e.g., "Female List Query") and click "Finish."
6. Switch to "Design View," enter Female in the "Gender" field's
Criteria row.
7. Click "Run" to see the results.
To Find the List Of Computer Science By Query Wizard:
1. Open Microsoft Access.
2. Go to "Create" > "Query Wizard."
3. Select "Simple Query Wizard" and click "OK."
4. Choose your table, add the "Name" and "Department" fields, then
click "Next."
5. Name the query (e.g., "Computer Science students List Query")
and click "Finish."
6. Switch to "Design View," enter Computer Science in the
"Department" field's Criteria row.
7. Click "Run" to see the results.

To Close the Database File:


1. Click close button of database.
Practical #02
Object:

Create a database of library having following fields or attributes.


• Book ID
• Name
• Lending Book Status
• Book issued

Instructions:
1. Create the suitable primary key.
2. Insert 10 records.
3. Set student ID as a primary key.
4. Find the list of books which are not for lending.
5. Find the list of books issued

Procedure:
To Create Microsoft Access Database:

1. Open Microsoft Access.


2. Click "File" > "New" > "Blank Database."
3. Enter a file name and click "Create."

To Create Books Table:

1. Click "Create" > "Table Design."


2. Enter the following fields:
• Field Name: Book ID (AutoNumber, set as Primary Key).
• Field Name: Book Name (Text).
• Field Name: Lending Book Status (Yes/No).
• Field Name: Book Issued (Yes/No).
3. Save the table with the name Books.

To Insert 10 Records:

1. Open the Books table in Datasheet View.


2. Enter 10 records with appropriate values for fields.

To Find the List of Books Not for Lending:

1. Go to "Create" > "Query Design."


2. Add the Books table to the query.
3. Drag the Book Name and Lending Book Status fields to the query
grid.
4. Enter No in the "Criteria" row under Lending Book Status.
5. Click "Run" to see the results.

To Find the List of Books Issued:


1. Go to "Create" > "Query Design."
2. Add the Books table to the query.
3. Drag the Book Name and Book Issued fields to the query grid.
4. Enter Is Not Null in the "Criteria" row under Book Issued.
5. Click "Run" to see the results.

To Close the Database File:


1. Click close button of database.
Practical #03
Object:

Create a database in MS Access of bank account, 2 tables, relationship


between 2 tables.
Required fields of table 1:
• Account ID
• Account Name
• Address
• Phone
• Email
Required fields of table 2:
• Account ID
• Account Status

Instructions:
1. Search the desire Account ID
2. Delete the desire Account ID
3. Also update desire Account ID
4. Relationships between 2 tables or between different two tables,
there are following options:
a. One to one relationship.

Procedure:
To Create Microsoft Access Database:
1. Open Microsoft Access.
2. Click "File" > "New" > "Blank Database."
3. Enter a file name and click "Create."

To Search the Desired Account ID:

1. Open the table/query and type the Account ID in the search box.
2. Press "Enter" to find the record.

To Delete the Desired Account ID:

1. Open the table/query.


2. Find the record, right-click, and select "Delete Record."
3. Confirm the deletion.

To update the Desired Account ID:

1. Open the table/query.


2. Find the record, edit the Account ID, and press "Save."

To Create Relationships Between Two Tables:

1. Click "Database Tools" > "Relationships."


2. Add the tables and drag related fields.
3. Select "One-to-One" and click "Create."

To Close the Database File:

1. Click the close button for the database.


Practical #04
Object:

Create student result database with following tables.


Biodata Table:
• Roll No
• Student
• Phone
• Address
• Class
• Year
Student Marks Table:
• Roll No
• English
• Computer
• Physics
• Mathematics
• Pakistan Studies
• Obtained Marks
• Total Marks
• Percentage

Instructions:
1. Assign primary Key, create relationship between tables & input 5
records.
2. Calculate percentage up to 2 decimals places by wing expression
builder.
3. Search the records of students who have secured the highest
marks in all students.

Procedure:
To Create Microsoft Access Database:

1. Open Microsoft Access.


2. Click "File" > "New" > "Blank Database."
3. Enter a file name and click "Create."

To Assign Primary Key, Create Relationships, and Input 5 Records:

1. Open Microsoft Access and create two tables (Students and


Marks).
2. Assign Roll No (AutoNumber) as the Primary Key in both tables.
3. Click "Database Tools" > "Relationships."
4. Add both tables and drag the Roll No field from Students to Marks
table to create a One-to-One relationship.
5. Open the tables in Datasheet View and input 5 records in each.

To Calculate Percentage (Up to 2 Decimal Places):

1. Click "Create" > "Query Design."


2. Add the Marks table to the query.
3. Drag fields Total Marks and Obtained Marks into the query grid.
4. Use Expression Builder to create a calculated field:
a. (([ObtainedMarks]/[TotalMarks])*100)

5. Save and run the query to calculate percentages.

To Search Students with the Highest Marks:

1. Click "Create" > "Query Design."


2. Add the Marks table to the query.
3. Drag the fields Student Name and Obtained Marks into the query
grid.
4. In the "Criteria" row for ObtainedMarks, use:
• =DMax("[ObtainedMarks]", "Marks").

5. Save and run the query to find students with the highest marks.

To Close the Database File:

1. Click the close button for the database.


Practical #05
Object:

Create Payroll Database.


Employee (Table 1):
• Employee Code
• Employee Name
• Employee F/Name
• Employee Address
• Job
• Appointment Date
Salary (Table 2):
• Employee Code
• Medical Allowance
• Conveyance Allowance
• House Rent
• Basic Pay

Instructions:
1. Assign primary Key, create relationship between tables & input 5
records.
2. Calculate Gross pay = Medical Allowance+ Conveyance Allowance+
House Rent+ Basic Pay.
3. Calculate Tax = Gross pay*5/100.
4. Calculate Net Pay = Gross pay -Tax.
5. Search the record where Net Pay is greater than 10,000
Procedure:
To Create Microsoft Access Database:

1. Open Microsoft Access.


2. Click "File" > "New" > "Blank Database."
3. Enter a file name and click "Create."

To Assign Primary Key, Create Relationships, and Input 5 Records:

1. Open Microsoft Access and create two tables (Employee and


Salary).
2. Assign Employee Code (AutoNumber) as the Primary Key in both
tables.
3. Click "Database Tools" > "Relationships."
4. Add both tables and drag the Employee Code field from Employee
to Salary table to create a One-to-One relationship.

5. Open the tables in Datasheet View and input 5 records in each.


To Calculate Gross Pay

1. Open the Salary table in Design View.


2. Add a calculated field named Gross Pay.
3. Use the formula: =[Medical Allowance]+[Conveyance
Allowance]+[Home Rent]+[Basic Salary].
4. Save the table.

To Calculate Tax:

1. Add a calculated field named Tax in the Salary table.


2. Use the formula: =[Gross Pay]*5/100.
3. Save the table.

To Calculate Net Pay:

1. Add a calculated field named Net Pay in the Salary table.


2. Use the formula: =[Gross Pay]-[Tax].
3. Save the table.

To Search the Record Where Net Pay is Greater Than 10,000:

1. Click "Create" > "Query Design."


2. Add the Salary table and include the fields Employee Code,
Employee Name, Employee F/Name, Job, and Net Pay.
3. In the "Criteria" row under Net Pay, enter >10000.

4. Run the query to see the results.

To Close the Database File:


1. Click the close button for the database.

You might also like