Practical File Last
Practical File Last
Practical No 1
Object
Create and print Utility Bill.
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 1 of 56
Meter Previous Current Units Electricity Amount
Number Unit Unit Consumed Charge Surcharge Payable
SN-2201 79536 79633 25
Procedure
1. Open MS Excel.
2. Select a new blank sheet.
3. Write a Heading of Utility Bill.
4. Make the format of Utility Bill.
5. Write a formula to calculate no of units consumed.
6. Calculate Electricity Charges.
7. Calculate Surcharge.
8. Calculate Total Amount.
9. Save file
10. For saving file click on file menu than click on save OR press
Ctrl + S.
Formula
1. To Calculate Unit Consumed.
=C4-B4
2. To Calculate Electricity Charge
=D4*25
3. To Calculate Surcharge
=F4/100*15
= F4+G4
Output
Object
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 3 of 56
Using the Spreadsheet, create and print the Expenditure of Pakistan Printing press in the
Year of 2023 (in Rs. Million).
Procedure
1. Open MS Excel.
2. Select a new blank sheet from file menu.
3. Create sheet that show Expenditure of Pakistan Printing press.
Formula:
=AVERAGE (B4:B9)
Output
Object
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 5 of 56
Using the Spreadsheet according to the instructions
Procedure
1. Open MS Excel.
2. Select a new blank sheet from file menu.
3. Create Sheet.
Formula
=G6-F6
Output
Procedure
1. Open MS Excel.
2. Select a new blank sheet from file menu.
3. Create Expenditure by different Provinces.
4. Create the column chart using the chart wizard from insert menu.
5. Set margins.
6. Save file OR Save as.
7. For saving file click on file menu than click on save OR press Ctrl + S.
8. Give a name to the file. Such as “Practical 4”.
9. Print the page.
10. For printing page click on file than click print or press Ctrl + P.
12. Close the Program
Output
Object
Create and print Attendance Register page showing 10 days attendance.
Procedure
1. Open MS Excel.
2. Select a new blank sheet from file menu.
3. Create Attendance Register.
4. Insert the formula as the given instruction.
5. Set margins.
6. Save file OR Save as.
7. For saving file click on file menu then click on save OR press Ctrl + S.
8. Give a name to the file. Such as “Practical 5”.
9. Print the page.
10. For printing page click on file then click print or press Ctrl + P.
11. Close the Program.
Formula
=COUNTIF (C4:L4,"P")
2. =M4/10*100
Write a program that take as input the price of a box of chocolates and total
number of chocolates in the box. The program finds and displays the price of
one chocolate. Also draw its flowchart.
ALGORITHM
Step 1 : START
Step 2 : INPUT box price
Step 3 : INPUT number of chocolates
Step 4 : unit price = box price/ number of chocolates
Step 5 : PRINT unit price
Step 6 : END
OUTPUT
FLOWCHART
OUTPUT
Write a program that takes radius of a circle as input. The program should
calculate and displays the Area and Circumference of circle. Also draw its
flowchart.
ALGORITHM
Step 1 : START
Step 2 : INPUT rad
Step 3 : Find the area
area= 3.14 x rad x rad
Step 4 : Find the circumference, cir
cir= 2 x 3.14 x rad
Step 5 : PRINT
area
cir
Step 6 : END
FLOWCHART
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 18 of 56
CODE
#include<stdio.h>
void main()
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 19 of 56
{
float rad, area, cir;
printf ("Enter a Radius:");
scanf ("%f",&rad);
area=3.14*rad*rad;
cir=2*3.14*rad;
printf ("Area Of Circle:%2f\n",area);
printf ("Circumferance:%2f",cir);
}
OUTPUT
Practical 4
Write a program to print the area and perimeter of a square when one side is
given. Also draw the flowchart.
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 20 of 56
ALGORITHM
Step 1 : Start
Step 2 : INPUT side
Step 3 : CALCULATE area by side * side
Step 4 : CALCULATE peri by 4* side
Step 5 : PRINT area of square in area
Step 6 : PRINT area of square in peri
Step 7 : END
CODE
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 22 of 56
#include<stdio.h>
void main()
{
float side,area,peri;
printf("Enter Lenght of side of square:");
scanf("%f",&side);
area=side*side;
peri=4*side;
printf("Area of square: %0.2f\n",area);
printf("Perimeter of square: %0.2f\n",peri);
}
OUTPUT
Practical 5
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 23 of 56
Write a program that inputs basic salary, number of sold and broken items.it
then calculates the gross salary of the employee. The bonus is Rs.10000 if
sold items are more than 100 and broken items are 0. Otherwise the bonus is
0.
ALGORITHM
STEP 1 : START
STEP 2 : INPUT bas, sol, bro
STEP 3 : IF sol > 100 AND bro =0 THEN bon=10000
ELSE gro=bas+(sol * 8) +bon
STEP 4 : PRINT gro
STEP 5 : END
FLOWCHART
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 24 of 56
CODE
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 25 of 56
#include<stdio.h>
void main ()
{
int bas, sol, bro, gro, bon=0;
printf ("enter basic salary:");
scanf ("%d”, &bas);
printf ("enter the number of sold items:");
scanf ("%d”, &sol);
printf ("enter the number of broken items:");
scanf ("%d”, &bro);
if(sol>100&&bro==0)
bon=10000;
gro=bas+(sol*8) +bon;
printf ("gross salary is %d”, gro);
}
OUTPUT
Practical 6
Write a program that inputs a year and determines whether it is a leap year or
not.
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 26 of 56
ALGORITHM
Step 1 : START
Step 2 : INPUT year
Step 3 : IF (year / 4) = 0
PRINT "Leap year"
ELSE
PRINT "Not leap year"
Step 4 : STOP
FLOWCHART
OUTPUT:
FLOWCHART
Practical 8
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 33 of 56
Write a program to calculate the electricity bill accordingly to the following
formula:
Bill= units consumed x unit price
Also draw its flowchart.
ALGORITHM
Step 1 : START
Step 2 : INPUT units
Step 3 : Calculate the unit
IF (units >400)
bill = units * 20
ELSE IF (units >200)
bill = units * 15
ELSE
bill = units * 12
Step 4 : PRINT bill
Step 5 : END
FLOWCHART
Practical 9
Write a program that takes percentage marks of a student as input and
displays his grade. The following table shows the grade criteria
FLOWCHART
Practical 10
Write a program that enters three numbers and prints the two larger ones.
ALGORITHM
Step 1 : START
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 39 of 56
Step 2 : INPUTvariablea,b,c
with different numbers
Step 3 : IF a<b AND a<c
PRINTb,c
ELSE IF b < c
PRINTa,c
ELSE
PRINTa,b
Step 4 : END
CODE
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 41 of 56
#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter three numbers : ");
scanf("%d %d %d",&a,&b,&c);
if(a<b && a<c)
printf("The Largest Two Numbers Are %d And %d.",b,c);
else if(b<c)
printf("The Largest Two Numbers Are %d And %d.",a,c);
else
printf("The Largest Two Numbers Are %d And %d.",a,b);
}
OUTPUT
Practical 11
FLOWCHART
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 43 of 56
CODE
Practical 12
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 45 of 56
Write A Program That Prints Alphabets from A to Z using Loop. Also draw
its flowchart.
ALGORITHM
Step 1 : Start
Step 2 : Let ch, be A
Step 3 : Print
Step 4 : If Character Is Lesser Or Equals To ‘Z’, Go to 3
Step 5 : If Character Is Greater Then ‘Z’, Go To 6
Step 6 : Stop
FLOWCHART
Practical 13
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 48 of 56
Write a program that takes a number as an input and prints its multiplication
able up to 10. Also draw its flowchart.
ALGORITHM
Step 1: START
Step 2: INPUT table number
Step 3: c=1
Step 4: IF c<=10 THEN GOTO STEP 5
ELSE GOTO STEP 7
Step 5: PRINT table no.,c,tab*c
Step 6: c=c+1
GOTO STEP 4
Step 7: END
FLOWCHART
Practical 14
ALGORITHM
STEP 1 : START
STEP 2 : INPUT N
STEP 3 : SUM=SUM+C
STEP 4 : Sum =%.2f
STEP 5 : Sum/n
STEP 6 : OUTPUT Sum, Av
STEP 7 : END
FLOWCHART
Practical 15
ALGORITHM
Step 1 : Start
Step 2 : Initialize n, p, j with numbers
Step 3 : Input a value
Step 4 : If n%j==0 let p=0
Step 5 : If p==1 Print n is a prime number
Step 6 : is not a prime number
Step 7 : End
FLOWCHART
CODE
#include<stdio.h>
void main()
NAME: HAIQA HASSAN – CLASS: X-A2 (Session 2023-2024) Page 55 of 56
{
int n, p, j;
printf("Enter a Number:");
scanf("%d",&n);
p = 1;
for(j=2; j<n; j++)
if(n%j==0)
p = 0;
if(p==1)
printf("%d is a prime number.",n);
else
printf("%d is not prime number.",n);
}
OUTPUT