1 Pu LAB - Manual Edited
1 Pu LAB - Manual Edited
Algorithm 1a:
Step 1: Start
Step 2: Input a, b
Step 3: temp=a
Step 4: a=b
Step 5: b=temp
Step 6: Display a, b
Step 7: Stop
Program 1a:
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,temp;
clrscr();
cout<<"Enter the value of a and b";
cin>>a>>b;
temp=a;
a=b;
b=temp;
cout<<"After swapping:"<<endl;
cout<<"Value of a = "<<a<<endl;
cout<<"Value of b = "<<b<<endl;
getch();
}
OUTPUT
1
1.b) Write a program to interchange the values of two variables without using a third
variable
Algorithm 1b:
Step 1: Start
Step 2: Input a, b
Step 3: a = a+b
Step 4: b = a-b
Step 5: a = a-b
Step 6: Display a, b
Step 7: Stop
Program 1b:
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
cout<<" Enter the value of a and b :"<<endl;
cin>>a>>b;
a=a+b;
b=a-b;
a=a-b;
cout<<"After swapping"<<endl;
cout<<"Value of a = "<<a<<endl;
cout<<"Value of b = "<<b<<endl;
getch();
}
OUTPUT
2
2. Write a program to find area and circumference of a circle.
Algorithm 2:
Step 1: Start
Step 2: Input r
Step 3: area=3.14*r*r
Step 4: circum=2*3.14*r
Step 5: Display area, circum
Step 6: Stop
Program 2:
#include<iostream.h>
#include<conio.h>
void main()
{
float r,area,circum;
clrscr();
cout<<"Enter the radius of the circle :";
cin>>r;
area=3.14*r*r;
circum=2*3.14*r;
cout<<"Area ="<<area<<endl;
cout<<"Circumference ="<<circum;
getch();
}
OUTPUT
3
3. Write a program to find area of a triangle given three sides.
Algorithm 3:
Step 1: Start
Step 2: Input a, b, c
Step 3: s=(a+b+c)/2
Step 4: area=sqrt(s*(s-a)*(s-b)*(s-c))
Step 5: Display area
Step 6: Stop
Program 3:-
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
float a,b,c,s,area;
clrscr();
cout<<"Enter value of three side of triangle:";
cin>>a>>b>>c;
s=(a+b+c)/2.0;
area=sqrt(s*(s-a)*(s-b)*(s-c));
cout<<"Area of a Triangle = "<<area;
getch();
}
OUTPUT
4
4. Write a program to convert days into years, months and days
Algorithm 4:
Step 1: Start
Step 2: Input totdays
Step 3: years = totdays / 365
Step 4: rem = totdays % 365
Step 5: months = rem / 30
Step 6: days = rem % 30
Step 7: Display years, months, days
Step 8: Stop
Program 4:
#include<iostream.h>
#include<conio.h>
void main()
{
int totdays,years,months,days,rem;
clrscr();
cout<<"Enter the total number of days ";
cin>>totdays;
years=totdays/365;
rem=totdays%365;
months=rem/30;
days=rem%30;
cout<<"Total days ="<<totdays<<endl;
cout<<"Years ="<<years<<endl;
cout<<"Months ="<<months<<endl;
cout<<"Days ="<<days<<endl;
getch();
}
OUTPUT
5
5. Write a program to find the largest, smallest and second largest of three numbers
using simple if statement.
Algorithm 5:
Step 1: Start
Step 2: Input a, b, c
Step 3: large = a
Step 4: if (large<b) then large = b
Step 5: if (large<c) then large = c
Step 6: small= a
Step 7: if (small>b) then small = b
Step 8: if (small>c) then small = c
Step 9: seclarge = (a + b + c) – (large + small)
Step 10: Display large,small,seclarge
Step 11: Stop
Program 5:
# include <iostream.h>
# include <conio.h>
void main()
{
int a,b,c;
int large,small,seclarge;
clrscr();
cout<<"Enter three numbers";
cin>>a>>b>>c;
large=a;
if(large<b)
large=b;
if(large<c) OUTPUT
large=c;
small=a;
if(small>b)
small=b;
if(small>c)
small=c;
seclarge=(a+b+c)-(large+small);
cout<<"Largest number ="<<large<<endl;
cout<<"Smallest number ="<<small<<endl;
cout<<"Second largest number ="<<seclarge<<endl;
getch();
}
6
6. Write a program to input the total amount in a bill, if the amount is greater than 1000
a discount of 8% is given otherwise no discount is given, output the total amount, the
discount amount and the final amount, use simple if statement.
Algorithm 6:
Step 1: Start
Step 2: Input totamt
Step 3: disc = 0
Step 4: if (totamt>1000) then
disc = totamt * 0.08
Step 5: finalamt = totamt - disc
Step 6: Display totamt, disc, finalamt
Step 7: Stop
Program 6:
#include<iostream.h>
#include<conio.h>
void main()
{
float totamt, disc, finalamt;
clrscr();
cout<<"Enter the total amount "<<endl;
cin>>totamt;
disc=0;
if(totamt>1000)
disc=totamt*0.08;
finalamt=totamt-disc;
cout<<"Total Amount ="<<totamt<<endl;
cout<<"Discount ="<<disc<<endl;
cout<<"Final Amount ="<<finalamt<<endl;
getch();
}
OUTPUT
7
7. Write a program to check whether a given year is a leap year or not using if-else
statement.
Algorithm 7:
Step 1: Start
Step 2: Input year
Step 3: if (year % 4 == 0)
then
Display “Leap Year”
Else
Display “Not a Leap Year”
Step 4: Stop
Program 7:
#include<iostream.h>
#include<conio.h>
void main()
{
int year;
clrscr();
cout<<"Enter the year"<<endl;
cin>>year;
if(year%4==0)
cout<<"leap year ";
else
cout<<" not a leap year ";
getch();
}
OUTPUT
8
8. Write a program to input a character and find out whether it is a lower case or upper
case character using if-else statement.
Algorithm 8:
Step 1: Start
Step 2: Input ch
Step 3: if (ch>=’A’ && ch<=’Z’) then
Display “Uppercase”
Else if (ch>=’a’ && ch<=’z’)
Display “Lowercase”
Else
Display “Not an alphabet”
Step 4: Stop
Program 8:
#include<iostream.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
cout<<"Enter any alphabet "<<endl;
cin>>ch;
if((ch>='A')&&(ch<='Z'))
cout<<"is a Uppercase alphabet";
else if((ch>='a')&&(ch<='z'))
cout<<"is a Lowercase alphabet";
else
cout<<"is not an alphabet";
getch();
}
OUTPUT
9
9. Write a program to input the number of units of electricity consumed in a house and
calculate the final amount using nested-if statement. Use the following data for
calculation.
Units Cost
consumed
<30 Rs.
3.50/unit
>=30 and Rs.
<50 4.25/unit
>=50 and Rs.
<100 5.25/unit
>=100 Rs.
5.85/unit
Algorithm 9:
Step 1: Start
Step 2: Input units
Step 3: if (units < 30) then
billamt = units * 3.50
Else if (units < 50) then
Program 9:
#include<iostream.h>
#include<conio.h>
void main()
{
int units;
float billamt;
clrscr();
cout<<"Enter the units consumed "<<endl;
cin>>units;
if(units<30)
billamt=units*30;
10
else if(units<50)
billamt=29*3.50+(units-29)*4.25;
else if(units<100)
billamt=29*3.50+20*4.25+(units-49)*5.25;
else
billamt=29*3.50+20*4.25+50*5.25+(units-99)*5.85;
cout<<"Total amount ="<<billamt;
getch();
}
OUTPUT
11
10. Write a program to input the marks of four subjects, calculate the total percentage and
output the result as either “First class”, or “Second class”, or “Pass class” or “Fails”
using switch statement.
Class Range %
First Class Between 60 and
100%
Second Class Between 50 and
59%
Pass Class Between 40 and
49%
Fails Less than 40%
Algorithm 10:
Step 1: Start
Step 2: Input m1, m2, m3, m4
Step 3: total = m1 + m2 + m3 + m4
Step 4: per = tot / 4 *100
Step 5: if (per >=60) then
Display “First Class”
Else if (per >=50) then
Display “Second Class”
Else if (per >=40) then
Display “Pass Class”
Else
Display “Fail”
Step 6: Stop
Program 10:
#include<iostream.h>
#include<conio.h>
void main()
{
int m1,m2,m3,m4,total,x;
float per;
clrscr();
cout<<"Enter 4 subject marks"<<endl;
cin>>m1>>m2>>m3>>m4;
total=m1+m2+m3+m4;
per=(float)total/4*100;
x=(int)per/10;
switch(x)
12
{
case 10:
case 9:
case 8:
case 7:
case 6: cout<<"First Class ";
break;
case 5: cout<<"Second Class ";
break;
case 4: cout<<"Pass Class ";
break;
default : cout<<" Fail ";
}
getch();
}
OUTPUT
13
11. Write a program to find the sum of all the digits of a number using while statement.
Algorithm 11:
Step 1: Start
Step 2: Input n
Step 3: sum=0
Step 4: Repeat step 5 through step 7 while n≠0
Step 5: digit = n mod 10
Step 6: sum = sum + digit
Step 7: n = n / 10
Step 8: Display sum
Step 9: Stop
Program 11:
#include<iostream.h>
#include<conio.h>
void main()
{
long n;
int sum,digit;
clrscr();
cout<<"Enter a number "<<endl;
cin>>n;
sum=0;
while(n!=0)
{
digit=n%10;
sum=sum+digit;
n=n/10;
}
cout<<"Sum of digits ="<<sum;
getch();
}
OUTPUT
14
12. Write a program to input principal amount, rate of interest and time period and
calculate compound interest using while statement.
Algorithm 12:
Step 1: Start
Step 2: Input p, t, r
Step 3: prinamt = p
Step 4: y = 1
Step 5: Repeat step 6 through step 8 until y<=t
Step 6: amt = p * (1 + r/100)
Step 7: y = y + 1
Step 8: p = amt
Step 9: ci = amt - prinamt
Step 10: Display ci
Step 11: Stop
Program 12:
# include <iostream.h>
# include <conio.h>
#include<iomanip.h>
void main()
{
clrscr();
float p,r,amt,prinamt,ci;
int t,y;
cout<<"Enter principal, time and rate of intrest"<<endl;
cin>>p>>t>>r;
y=1;
prinamt=p;
while(y<=t)
{
amt=p*(1+r/100); OUTPUT
p=amt;
y++;
}
ci=amt-prinamt;
cout<<"Compound Intrest ="<<ci;
getch();
}
15
13. Write a program to find the power of 2 using do-while statement.
Algorithm 13:
Step 1: Start
Step 2: Input n
Step 3: m=n
Step 4: rem = n mod 2
Step 5: if (rem = 1) then
flag=0
Step 6: n=n/2
Step 7: Repeat step 4 through step 6 until n>1
Step 8: if (flag)
Display “Number is a power of 2”
else
Display “Number is not a power of 2”
Step 8: Stop
Program 13:
#include<iostream.h>
#include<conio.h>
void main()
{
int n,m,flag,rem;
clrscr();
cout<< “Enter a number";
cin>>n;
m=n;
flag=1;
do
{
rem=n%2;
if(rem==1)
flag=0; OUTPUT
n=n/2;
}while((n>1)&&(flag));
if(flag)
cout<<m<<" is a power of 2 ";
else
cout<<m<<" is not power of 2";
getch();
}
16
14. Write a program to check whether a given number is an Armstrong number using do-
while statement.
Algorithm 14:
Step 1: Start
Step 2: Input num
Step 3: temp = num
Step 4: sum=0
Step 5: digit = num mod 10
Step 6: sum = sum + digit*digit*digit
Step 7: num = num / 10
Step 8: Repeat step5 through step7 while num≠0
Step 9: if (temp = sum) then
Display “Armstrong number”
Else
Display “Not an Armstrong number”
Step 10: Stop
Program 14:
#include<iostream.h>
#include<conio.h>
void main()
{
int num,temp,sum,digit;
clrscr();
cout<<"Enter three digit number "<<endl;
cin>>num;
temp=num;
sum=0; OUTPUT
do
{
digit=num%10;
sum=sum+digit*digit*digit;
num=num/10;
}while(num!=0);
if(temp==sum)
cout<<” is an Armstrong number";
else
cout<<"is not Armstrong number";
getch();
}
17
15. Write a program to find factorial of a given number.
Algorithm 15:
Step 1: Start
Step 2: Input n
Step 3: fact = 1
Step 4: Repeat step 6 for i = 1 to n do
Step 6: fact = fact * i
Step8: Display fact
Step 9: Stop
Program 15:
# include <iostream.h>
# include <conio.h>
void main()
{
int i,n;
long fact;
clrscr();
cout<<"Enter non-negative number";
cin>>n;
fact=1;
for(i=1;i<=n;i++)
fact=fact*i;
cout<<"Factorial ="<<fact;
getch();
}
OUTPUT
18
16. Write a program to generate the Fibonacci sequence up to a limit using for statement.
ALGORITHM 16:
Step 1: Start
Step 2: input n
Step 3: f1=0
f2=1
Step 4: Output f1, f2
Step 5: for i=2 to n do
Step 6: f3=f1+f2
Step 7: Output f3
Step 8: f1=f2
f2=f3
[End of for loop]
Step 9: Stop
PROGRAM 16:
#include<iostream.h>
#include<conio.h>
void main()
{
int n,f1,f2,f3, i;
clrscr();
cout<<”Enter the nth term”<<endl;
cin>>n;
f1=0;
f2=1;
cout<<”Fibonacci Series:”<<endl;
cout<<f1<<endl<<f2<<endl;
for(i=2;i<=n;i++)
{
f3=f1+f2;
cout<<f3<<endl; OUTPUT
f1=f2;
f2=f3;
}
getch();
}
19
17. Write a program to find the sum and average of “N” numbers.
ALGORITHM 17:
Step 1: start
Step 2: input n
Step 3: for i=0 to n-1
input a[i]
[ end for ]
Step 4: sum=0
Step 5: for i=0 to n-1
sum=sum+a[i]
[end for ]
Step 6: avg=sum/n
Step 7: output sum, avg
Step 8: stop
PROGRAM 17:
#include<iostream.h>
#include<conio.h>
void main()
{
int a[10],i , n, sum;
float avg;
clrscr();
cout<<”how many elements?”;
cin>>n;
cout<<”enter the elements”;
for(i=0;i<n; i++)
cin>>a[i]; OUTPUT
sum=0;
for(i=0;i<n; i++)
sum=sum+a[i];
avg=(float)sum/n;
cout<<”sum=”<<sum<<endl;
cout<<”average=”<<avg;
getch();
}
OUTPUT:
Flowchart 18:
21
22
19. Write a program to arrange a list of numbers in ascending order.
FLOWCHART 19:
23
24
20. Write a program to find the position of a given number in an array.
25
FLOWCHART 20:
26
21.Write a program to check whether a given matrix is scalar
27 }
FLOWCHART 21:
28
22. Write a program to find sum of all the rows and the sum of all the columns of a matrix
separately.
29
FLOWCHART 22:
30
31
23. Write a program to find the sum of two compatible matrices.
32
FLOWCHART 23:
33
24. Consider an array MARKS[20][5] which stores the marks obtained by 20
students in 5 subjects. Now write a program to
a) Find the average marks obtained in each subject b) Find the average marks
obtained by every student c) Find the number of students who have scored below
50 in their average
double avg;
ALGORITHM 24: clrscr();
Step 1: start cout<<"Enter Marks...:"<<endl;
Step 2: for i = 0 to 2 for(i=0;i<3;i++)
for j = 0 to 3 for(j=0;j<4;j++)
input marks[i][j] cin>>marks[i][j];
[ END for ] cout<<endl<<"Subject Average....\n";
[ END for ] cout<<"\nSUB 1\tSUB 2\tSUB 3\tSUB
Step 3: for i = 0 to 4-1 4"<<endl;
total = 0 cout<<setprecision(5);
for j = 0 to 2 for(i=0;i<4;i++)
total = total + marks[j][i] {
[ END for ] total = 0;
average = total / 3 for(j=0;j<3;j++)
print average total = total + marks[j][i];
[ END for ] avg = total/3;
Step 4: count = 0 cout<<" "<<avg<<"\t";
Step 5: for i = 0 to 2 }
total = 0 cout<<endl<<endl<<"Student Average....\n";
for j = 0 to 3 cout<<"\nStudent \t Average"<<endl;
total = total + marks[i][j] for(i=0;i<3; i++)
[ END for ] {
average = total / 4 total = 0;
if ( average < 50 ) for(j=0;j<4;j++)
count = count + 1 total = total + marks[i][j];
[ END if ] avg = total/4;
print average if(avg < 50)
[ END for ] count++;
Step 6: print count
cout<<" "<<i+1<<"\t\t "<<avg<<endl;
Step 7: stop
}
cout<<"\n\nNumber of students lesss than
PROGRAM 24:
#include<iostream.h> 50% is "<<count<<endl;
#include<conio.h> getch();
#include<iomanip.h>
void main() }
{
int marks[20][5],i,j,total,count=0;
FLOWCHART 24: OUTPUT:
34
25. Write a program to check whether a given string is a palindrome or not.
35
ALGORITHM 25: FLOWCHART 25:
Step 1: start
Step 2: input str
Step 3: copy string str to rstr
Step 4: reverse the string rstr
Step 5: if (str = rstr)
print str ,“ is a palindrome ”
else
print str, “ is not a palindrome ”
[end if]
Step 6: stop
PROGRAM 25:
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
char str[25], rstr[25];
clrscr();
cout<<"Enter String :";
cin.getline(str,25);
strcpy(rstr, str);
strrev(rstr);
if(strcmp(str,rstr)==0)
cout<<str<<" is a Palindrome";
else
cout<<str<<" is Not a Palindrome";
getch();
}
OUTPUT:
26. Write a program to count the number of vowels and consonants in a string.
36
ALGORITHM:
Step 1: Start
Step 2: input s
Step 3: len = strlen(s)
Step 4: vow = 0
Step 5: cons = 0
Step 6: for i = 0 to len-1
if((st[i] is an alphabet)then
if(st[i]=’A’ or st[i]=’a’ or st[i]=’E’ or st[i]=’e’ or st[i]=’I’ or st[i]=’i’ or st[i]=’O’ or st[i]=’o’
or st[i]=’U’ or st[i]=’u’)
vow = vow + 1
else
cons = cons + 1
[ END if ]
[ END if ]
[ END for ]
Step 7: print vow, cons
Step 8: Stop
FLOWCHART 26:
37
27. Write a program to find the GCD and LCM of two numbers using functions.
38
ALGORITHM 27:
Step 1: start PROGRAM 27:
Step 2: input a. b
Step 3: g = gcd(a, b) #include<iostream.h>
Step 4: lcm = (a * b)/g #include<conio.h>
Step 5: display g, lcm void main()
Step 6: stop {
int gcd(int, int);
FUNCTION gcd(a,b) int a,b,g,lcm;
Step 1: while(a!=b) clrscr();
if(a>b) cout<<"Enter Two numbers :";
a=a-b cin>>a>>b;
else g = gcd(a, b);
b=b-a lcm = (a * b) / g;
[end if] cout<<"GCD = "<<g<<endl;
[ end while ] cout<<"LCM = "<<lcm<<endl;
Step 2: return a getch();
}
OUTPUT: int gcd(int a, int b)
{
while(a!=b)
{
if(a>b)
a = a - b;
else
b=b-a;
}
return(a);
}
FLOWCHART 27:
39
28. Write a program to find XY using functions.
40 PROGRAM 28:
#include<iostream.h>
#include<conio.h>
void main()
ALGORITHM 28:
Step 1: Start
Step 2: input a, n
Step 3: p = expo (a,n )
Step 4: display p
Step 5: stop
FUNCTION expo(a, n)
Step 1: if(a=0)
return(0)
else
if(n=0)
return(1)
else
if(n>0)
return(a * expo(a, n-1))
else
return(expo(a, n+1)/a)
[END if]
OUTPUT:
41
FLOWCHART 28:
29. An industrial organization wants to computerize the Allowance calculations. Given the
monthly Sales for the salesman, the rules for the calculations are as follows:
a. If the total sales is less than Rs. 10000/- there is no allowance.
b. If the total sales is between Rs. 10000/- and Rs. 20,000/- then the Allowance is 10% of the sales
amount or Rs. 1800/- whichever is minimum.
c. If the total sales is greater than or equal to Rs. 20000/- then the allowance is 20% of the sales
amount or Rs.6,000/- whichever is minimum. Write a program using a function to calculate the
allowance.
PROGRAM 29:
ALGORITHM 29: #include<iostream.h>
Step 1 : Start #include<conio.h>
Step 2 : Input sales void main()
Step 3 : allowance = company(sales) {
Step 4 : Print allowance float company(float);
Step 5 : Stop float sales, allowance;
clrscr();
FUNCTION COMPANY(SALES) cout<<"Enter the Sales Value :";
Step 1 : if(sales < 10000) cin>>sales;
allowance = 0.0 allow = company(sales);
else cout<<"\n Allowance = "<< allowance
if(sales >= 10000 && sales < 20000)) <<endl;
allowance = sales * 0.1 getch();
if(allowance > 1800) }
allowance = 1800 float company(float sales)
[ end if ] {
else float allowance;
if(sales >= 20000) if(sales < 10000)
allowance = sales * 0.2 allowance = 0.0;
if(allowance >= 6000) else
allowance = 6000 if(sales>10000 && sales < 20000)
[ end if] {
[ end if ] allowance = sales * 0.1;
[ end if ] if(allowance > 1800.0)
Step 2 : return allowance allowance = 1800.00;
}
else
if(sales >= 20000)
{ allowance = sales * 0.2;
if(allowance > 6000.0)
allowance = 6000.00;
}
return(allowance); }
}
FLOWCHART 29:
OUTPUT:
30. Write a program to input the register number, name and class of all the students in a class
into a structure and output the data in a tabular manner with proper headings.
ALGORITHM 30:
Step 1: Start
Step 2: input n
Step 3: create a student structure with the members regno, name[20], class[4]
Step 4: declare array of strudent structure as s[50]
Step 5: for i = 0 to n-1
input s[i].regno, s[i].name, s[i].class
[ end for]
Step 6: for i = 0 to n-1
Output s[i].regno, s[i].name, s[i].class
[end for]
Step 7: Stop
PROGRAM 30:
#include<iostream.h> cout<<s[i].rno<<"\t"<<s[i].name<<"\t"
#include<conio.h> <<s[i].sec<<endl;
struct student getch();
{ }
int rno;
char name[30];
char sec[10];
}; OUTPUT:
void main()
{
student s[50];
int i,n;
clrscr();
cout<<"Maximum Students :";
cin>>n;
for(i=0;i<n;i++)
{
cout<<"\nStudent # "<<i+1<<endl;
cout<<"Reg. No : ";
cin>>s[i].rno;
cout<<"Name : ";
cin.getline(s[i].name,30);
cout<<"Class: ";
cin>>s[i].sec;
}
cout<<"\n\nREG.NO\tNAME\tCLASS\t\n";
for(i=0;i<n;i++)
FLOWCHART 30:
Spread Sheet
1. Eight salesmen sell three products for a week. Using a spreadsheet create a sales report. The
report should include the name of the salesman, Amount of sales for each product and the
salesman’s total sales in the format given below.
1) Type in all text and numbers in the spreadsheet.
7) Create a formula to calculate the total sales for all sales rep's for the month.
A B C D E
1 Sales for Month
2 Name Product 1 Product 2 Product 3 Total Sales
Amount Amount Amount
3 =B3+C3+D3
10
11 =SUM(B3:B10
Product Total ) =SUM(C3:C10) =SUM(D3:D10)
12 TOTAL SALES FOR ALL SALES REPRESENTATIVES FOR THE =SUM(E3:E10)
MONTH=
1. Enter the data for the columns name, product1, product2, product3.
6. Enter the formula =sum (B3:B10) into the cell B11 to find total amount for product1
and apply the formula for product2 and product3 and total sales for all salesmen for the
month.
8) If Total salary is greater than 5,00,000, compute Tax as 20% of Total salary otherwise 10% of the
Total salary using a formula.
A B C D E F G H I
1 Salary for Month
2 Emp Employe Basic DA HRA Loan Total Annual Tax
code e Name Salary Salary Income
3
10
11
12
1. Enter the details for 10 employees for employee code, name, Basic salary and loan.
6. FORMULAE: Apply these formulae for all the cells of the respective columns.
COLUMN CELL
NAME ADDRESS FORMULA
DA D3 =C3*50%
HRA E3 =C3*12%
MONTHLY =C3+D3+E3-F3
G3
SALARY
TOTAL ANNUAL =G3*12
H3
SALARY
=IF(H3>=500000,H3*20%,H3*10%)
TAX I3
3. Enter the following details for 10 Students Register Number, Name, Subject1 Marks, Subject2
Marks, Subject3 Marks, Subject4 Marks, Total Marks and Percentage.
1) Type the Register Number, Name and marks of four subjects’ for10students in the spreadsheet.
4) Create a formula to compute the Total marks and copy this to all the Cells.
5) Create a formula to compute Percentage and copy this to all the cells.
6) Create a formula to compute the highest and lowest score using a library function.
8) Draw Pie chart for one student showing his marks in different subject from total score
A B C D E F G H I J
1 Test Marks Data of a Class
2 Reg Name Sub 1 Sub 2 Sub 3 Sub 4 Total Perce Highest Lowest
No Marks Marks Marks Marks Marks ntage
3
10
11
12
1. Enter the details for 10 students such as Regno, name, sub1 marks, sub2 marks, sub3
marks, sub4 marks.
4. Create the formula to compute total marks, percentage, highest marks and lowest marks in the
respective cells
CELL
COLUMN NAME ADDRESS FORMULA
Total marks G3 =sum(c3:f3)
Percentage H3 =average(c3:f3)
Highest marks I3 =max(c3:f3)
Lowest marks J3 =min(c3:f3)
6. Draw a pie chart for one student showing his marks in different subjects from total score
Select the cells C3 : F3
Insert pie 2-D pie
Layout Chart title Above the chart type the respective student name
Right Click on graph select data horizontal axis label edit select c2 to f2
headings ok
4. A housewife maintains the budget expenditure in a spreadsheet under the headings Income and
Expenses. Income includes husband’s and Wife’s income separately under different headings.
Expenses include Rent, Bills, Household expenses and medical expenses.
1. Type the Income and Expenses data for the entire month in the spreadsheet.
2. Format all numbers as currency.
3. Center the spreadsheet headings across the spreadsheet.
4. Create a formula to compute the Total expenditure and copy this to all the cells.
5. Create a formula to compute the savings and copy this to all the cells.
6. Draw a bar graph to show expenditure under each heading.
7. Draw Pie chart to show the distribution of salary.
A B C D E F G H I
1 Budget for the Month
2 Week Income Expenses Total Savings
Number Expenditure
3 Husband Wife Rent Bill Household Medical
4 Week1
5 Week2
6 Week3
7 Week4
8 Total
1. Enter the details for the columns such as week of the month, income for husband and wife, expenses
for rent, bill, house hold, medical for 4 weeks
2. Enter the formula =sum (d4:g4) in the cell h4 to calculate the expenditure. Apply the formula for all
the cells till h8.
3. Select rows HOME Cells Format auto fit Row Height.
Select columns HOME Cells format Auto fit column Width.
4. To center the spreadsheet heading
Select A1:I1
HOME Merge and Center.
5. FORMULA:
H4 Total expenditure for Week 1 =SUM(D4:G4)
H8 Total expenditure for month =SUM (H4:H7
D8 Total Rent for Month =SUM(D4:G4)
E8 Total Bill for Month =SUM(E4:E7)
F8 Total Household for Month =SUM(F4:F7)
G8 Total Medical Expense for Month =SUM(G4:G7)
I8 Total Savings For Month =B8+C8-H8
6. Draw a bar graph to show expenditure under each heading.
Select the cells D8:G8
Insert 2 D Bar
Choose design select data
o Select horizontal axis label Edit select the cells D3:G3 ok
o Select series1 Edit type series name as Expenses.
Layout chart title above the chart type “Monthly expenditure chart”
Layout axis title primary vertical axis vertical title type “Headings”
Layout axis title primary horizontal axis title below axis type “amount in Rs”
7. Draw a pie chart to show the distribution of salary.
Select the cells D8:G8and select I8 holding Ctrl key.
Insert pie 2-D pie
Layout Chart title Above the chart Distribution of monthly salary
Right Click on graph select data horizontal axis label edit select d3 to g3
headings ok
Right Click on the graph select data horizontal axis label edit ctrl key +select the
heading savings ok
5. A Bank offers loan for housing and vehicle at an interest of 10.25% for housing and 14.2% for
vehicle. For all the 5 loan applicants compute the monthly premium (EMI), given total
installments as 24 months. Also compute the monthly interest and monthly principal amount and
the total amount of principal and Interest paid using Financial library functions in a spreadsheet.
A B C D E F G H I J
1 JGI Bank
1st
2
Applic Noof Rate Month
ant Loan Loan Installments of Monthly 1st month principa Total Total
name type amount interest EMI interest l principal Interest
3
4
5
6
7
8
9
10
11
12
13
14
Enter the details for the columns such as applicant name, loan type , loan amount number of
installment as 24.
Then enter the following formula in the respective cells.
Date Functions:
Time Functions:
Text Functions: