COMPUTER PRACTICES LABORATORY I DOCUMENT CREATION, TEXT MANIPULATION WITH SCIENTIFIC NOTATIONS Aim: To open a new open office document and perform the following operations in it. 1. Text Alignment 2. Change line spacing to 1.5 3. Place a box to the entire text 4. Add the bullets and numbering 5. Change type of font types and sizes 6. Insert the symbols Algorithm: 1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer. 2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name at the top of the screen. 3. Enter some text in it and select the text and make it as justified text by clicking Align Left icon in the tool bar or ctrl+L. 4. Enter some text in it and select the text and make it as justified text by clicking Align Right icon in the tool bar or ctrl+R. Computer Science & Engineering Page 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
COMPUTER PRACTICES LABORATORY I
DOCUMENT CREATION, TEXT MANIPULATION WITH
SCIENTIFIC NOTATIONS
Aim:
To open a new open office document and perform the following operations in it.
1. Text Alignment
2. Change line spacing to 1.5
3. Place a box to the entire text
4. Add the bullets and numbering
5. Change type of font types and sizes
6. Insert the symbols
Algorithm:
1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name
at the top of the screen.
3. Enter some text in it and select the text and make it as justified text by clicking
Align Left icon in the tool bar or ctrl+L.
4. Enter some text in it and select the text and make it as justified text by clicking Align Right icon in the tool bar or ctrl+R.
5. Enter some text in it and select the text and make it as justified text by clicking Align Center icon in the tool bar or ctrl+E.
6. Enter some text in it and select the text and make it as justified text by clicking Align Justification icon in the tool bar or ctrl+J.
7. Make a line spacing between the lines as 1.2 using Format > Paragraph > Indent & Spacing then select line spacing as fixed and change it to 1.5
Computer Science & Engineering Page 1
COMPUTER PRACTICES LABORATORY I
8. To insert a box to a text select the box from drawing tool by , ToolBar -> Drawing
9. Makes the text as bullets and numbering by Format > Bullets and Numbering.
10. Change the style and size of the text by using the options in the tool bar or use Format > Character.
11. Insert special characters by Insert > Special Characters.
Output:
1. Text Alignment
LEFT
A computer is a programmable machine that receives input, stores and manipulates data/information, and provides output in a useful format.
RIGHT
Input: Information and programs are entered into the computer through Input devices such as the keyboard, disks, or through other computers via network connections or modems
connected to the Internet. The input device also retrieves information off disks.
CENTER
Output: Output Devices displays information on the screen (monitor) or the printer and sends information to other computers. They also display messages about what errors may
have occurred and brings up message or dialog box asking for more information to be input. The output device also saves information on the disk for future use.
JUSTIFY
Processing: The CPU or central processing unit is sometimes called the Control Unit and directs the operation of the input and output devices. The Coprocessor or the Arithmetic-Logic Unit does arithmetic and comparisons. The memory or RAM temporarily stores information (files and programs) while you are using or working on them. The BIOS or basic input/output system controls the dialogue between the various devices.
2. Change line spacing to 1.5
Line Spacing - 1.0
The CPU or central processing unit is sometimes called the Control Unit and directs the operation of the input and output devices. The Coprocessor or the Arithmetic-Logic Unit does arithmetic and comparisons. The memory or RAM temporarily stores information
Computer Science & Engineering Page 2
COMPUTER PRACTICES LABORATORY I
(files and programs) while you are using or working on them. The BIOS or basic input/output system controls the dialogue between the various devices.
Line Spacing – 1.5
The CPU or central processing unit is sometimes called the Control Unit and directs the
operation of the input and output devices. The Coprocessor or the Arithmetic-Logic Unit
does arithmetic and comparisons. The memory or RAM temporarily stores information
(files and programs) while you are using or working on them. The BIOS or basic
input/output system controls the dialogue between the various devices.
3. Placing a box to the entire text
4. Adding bullets and numbering
Bullets Keyboard Mouse
Numbering1. Printer2. Monitor
5. Changing type of font types and sizes
Times New Roman 8
Verdana 10
Book Antiqua 12
Arial black 14
6. Inserting the symbols
Pie - ∏
Summation - ∑
Computer Science & Engineering Page 3
UNITED INSTITUTE OF TECHNOLOGY
COMPUTER PRACTICES LABORATORY I
7. Superscript and Subscript
(A+B)2 = A2+ B2 + 2AB
Ca(HCO3)2 -> CaCO3 + Co2 + H2O
8. Inserting Equations
Result:
Thus the required operations in the word document have been made and the output has been obtained.
Computer Science & Engineering Page 4
COMPUTER PRACTICES LABORATORY I
ADVERTISEMENT
Aim:
To prepare an advertisement to a company with the following specifications
i. Attractive Page Border.
ii. Design the name of company using WordArt.
iii. Use ClipArt
Using of OpenOffice writer.
Algorithm:
1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name
at the top of the screen.
3. Save file use File > Save As> give valid name and click Save.
4. Select the Page Border use Format > Page > Borders then select your style of Page Border.
5. Design the company name use View > Toolbars > FontWork Enable FontWork Option and Design Company Name.
6. Insert ClipArt use Insert > Pictures select the picture and insert.
Computer Science & Engineering Page 5
COMPUTER PRACTICES LABORATORY I
Output:
Result:
Thus the above Advertisement to a company has been designed and the output has been obtained.
Computer Science & Engineering Page 6
COMPUTER PRACTICES LABORATORY I
VISITING CARD
Aim:
To design a Visiting Card for a company following specification
i. Size of the Visiting Card 4” X 3”.
ii. Name of the company with a WortArt.
Using of OpenOffice writer.
Algorithm:
1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name
at the top of the screen.
3. Save file use File > Save As> give valid name and click Save.
4. Size of Visiting Card use Format > Page > Page > then change the Width and height
5. Design the company name use View > Toolbars > FontWork Enable FontWork Option and Design Company Name
OUTPUT:
Result:
Thus the above Visiting Card to a company has been designed and the output has been obtained.
Computer Science & Engineering Page 7
COMPUTER PRACTICES LABORATORY I
LETTER HEAD
Aim:
To Create a Letter Head for UIT College Using of OpenOffice writer.
Algorithm:
1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name
at the top of the screen.
3. Save file use File > Save As> give valid name and click Save.
4. Size of Visiting Card use Format > Page > Header > then Enable Header On option
5. Size of Visiting Card use Format > Page > Footer > then Enable Footder On option
Computer Science & Engineering Page 8
COMPUTER PRACTICES LABORATORY I
OUTPUT:
Result:
Thus the above Letter Head for UIT College has been designed and the output has been obtained.
Computer Science & Engineering Page 9
COMPUTER PRACTICES LABORATORY I
SCIENTIFIC NOTATION AND FORMULA
Aim:
To create Scientific Notation and Formula using OpenOffice.org.
Algorithm:
1. To open OpenOffice writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document appears on your screen with name
at the top of the screen.
3. Save file use File > Save As> give valid name and click Save.
4. Scientific Notation use Format > Character > Position then Enable Superscript and Subscript options
5. Insert Formula use Insert > Object > formula then Enter your Formula
Output:
Scientific Notation:
(A+B)2 = A2+ B2 + 2AB
Ca(HCO3)2 -> CaCO3 + Co2 + H2O
Formula:
Result:
Thus the above Scientific Notation and Formula created and the output has been obtained.
Computer Science & Engineering Page 10
COMPUTER PRACTICES LABORATORY I
TABLE CREATION, TABLE FORMATTING AND CONVERSION
Aim:
To perform Table Creation, Formatting and Conversion using OpenOffice.org .
Algorithm:
1. To open Open Office writer use , Start > All Programs > OpenOffice.org 3.2 > OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document now a text document
appears on your screen with name at the top of the screen.
3. To insert a new table, position the cursor where you want the table to appear, then use any of the following methods to open the Insert Table dialog box:
From the main menu, select Table > Insert > Table.
Press Ctrl+F12.
From the Standard toolbar, click the Table icon
4. Under Size, change the no of columns and rows based on the document.
5. In the Options space,
Heading defines the first row(s) in the table as headings
Repeat heading repeats the heading row(s) of the table at the top of subsequent pages if the table spans more than one page.
Don’t split table prevents the table from spanning more than one page.
Border surrounds each cell of the table with a border. This border can be modified or deleted later.
The AutoFormat button opens a dialog from where it is possible to select one of the many predefined table layouts.
6. Click OK to create the table of your choice.
7. To insert rows in the table later,
Use tab key to add rows in the last column.
Computer Science & Engineering Page 11
COMPUTER PRACTICES LABORATORY I
Click Table > Insert > Rows or click the Insert Rows icon .
Right click select Row > insert
8. To insert columns in the table later,
Click the second column, Table > Insert > Columns or click the Insert
Column icon.
Right click select Column > insert.
9. To delete rows and columns,
Click in one of the empty rows you just added, click Table > Delete > Rows
or click the Delete Row icon(The row is deleted.).
Click in the empty column you just added, click Table > Delete > Columns
or click the Delete Column icon on the Table Toolbar(The middle column is deleted.).
10. For Table Conversion,
Select the text and click Table > Convert > Text to Table > Paragraph. Under Separate text at, select Tabs or Semicolon or Other to determine what will be used to divide the data into different cells.
To convert table into text, click in the table then click Table > Convert > Table to Text > Paragraph.
11. To Delete Table,
Click the table you want to delete.
Click Table > Delete > Table.
Computer Science & Engineering Page 12
COMPUTER PRACTICES LABORATORY I
Output:
Table To Text Conversion
Roll_No;Name
101;Senthil kumar K
102;Raj Kumar P
103;Sathish B
Text To Table Conversion
Roll_No
Name
101 Senthil kumar K
102 Raj Kumar P
103 Sathish B
Result:
Thus the operations on the table have been performed and the required output has been obtained using OpenOffice.org
Computer Science & Engineering Page 13
COMPUTER PRACTICES LABORATORY I
MAIL MERGE AND LETTER PREPARATION
Aim:
To perform mail merge and letter preparation using OpenOffice.org.
Algorithm:
1. To open Open Office writer use , Start > All Programs > OpenOffice.org 3.2 >
OpenOffice.org Writer.
2. On the Menu Bar click, File > New > Text Document.
3. Click Tools > Mail Merge Wizard, the Mail Merge Wizard window will appear.
4. Under select starting document select create a new document then click next.
5. Select document type as letter, then click next.
6. In the address list click OK then click next.
7. In the create salutation space check this document should contain a salutation then
click next.
8. In the adjust layout space, we can adjust the alignment and salutation position and
10. Personalize document, we can edit individual document.
11. Save the document by clicking save starting document button and enter the
document name, click OK.
12. Click Finish.
Computer Science & Engineering Page 14
COMPUTER PRACTICES LABORATORY I
Output:From
M.Anantha Krishnan
BE CSE A I YEAR
United Institute of Technology
Coimbatore-20.
To
Mr.N.K.Madhavan
No.15,IT Quarters,
Coimbatore - 641044
India
Respected Sir/Madam,
SUBJECT: Regarding a symposium on Internet.
I take great privilege to welcome you for the symposium which is to
be conducted in our college. The symposium is about the various advancements in
internet.Mr.Bill Gates ,chairman of Microsoft Corporation has accepted to
deliver a guest lecture on 27th of September 2008.The program commences by
10.00 am and ends by 12.30 pm.Kindly grace this occasion with your august
presence.
Thanking you.
Yours Sincerely
M.Ananthakrishnan
Result:
Thus the mail merge operation have been performed and the required output has
been obtained.
DRAWING – FLOW CHART
Computer Science & Engineering Page 15
COMPUTER PRACTICES LABORATORY I
Aim:
To draw a flow chart for a given problem in the OpenOffice.org.
Algorithm:
1. Open a new open office document.2. Open drawing toolbar by clicking View > Toolbars > Drawing.3. Draw a flow chart for the given problem by using the drawing tool bar.
Output:
Result:Thus the flow chart has been drawn for the greatest of three numbers problem
and the required output has been obtained.
Computer Science & Engineering Page 16
COMPUTER PRACTICES LABORATORY I
CHART – LINE, XY, BAR AND PIE
Aim:
To Draw a line, XY, bar and pie chart for a given user data in OpenOffice.org Calc .
Thus the C program for Arithmetic operations have been executed and the required output has been obtained.
PASCAL’S TRIANGLE
Computer Science & Engineering Page 28
COMPUTER PRACTICES LABORATORY I
Aim:
To write a C program to print the Pascal’s triangle.
Algorithm:
1. Start.
2. Get the number of lines to print from the user.
3. Generate the triangle by using conditional loops.
4. Print the triangle.
5. Stop.
Flowchart:
Computer Science & Engineering Page 29
Start
Stop
COMPUTER PRACTICES LABORATORY I
Coding:
#include<stdio.h>
#include<conio.h>
void main()
{
int n=1,c=1,i,r,a=1,b=0;
clrscr();
printf("\t\t\tPASCAL's TRIANGLE");
printf("\n\nEnter the number of rows to print:");
scanf("%d",&r);
printf("\n\n");
while(n<=r)
{
while(a<r)
{
printf(" ");
a=a+1;
}
for(i=n;i<=c;i++)
printf(" %d",i);
for(i=c-1;i>=n;i--)
printf(" %d",i);
printf("\n");
c=c+2;
n=n+1;
b=b+1;
a=b+1;
}
getch();
}
Computer Science & Engineering Page 30
COMPUTER PRACTICES LABORATORY I
Output:
PASCAL's TRIANGLE
Enter the number of rows to print:5
1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5
Result:
Thus the C program for pascal’s triangle has been executed and the required output has been obtained.
FIBONACCI SERIES
Computer Science & Engineering Page 31
Start
Read n
COMPUTER PRACTICES LABORATORY I
Aim:Write a C program to printa Fibonacci series for a limit.
Algorithm:1. Open a new file.2. Get the limit or length of the series from the user.3. find the elements of the series 4. Print the elements
Flowchart:
No
Yes
Coding:
#include<stdio.h>
Computer Science & Engineering Page 32
Assign f1=-1,f2=1,f3=0
for ( i=0 ; i<n ;i++)
c= a+b
Print c
a=bb=c
Stop
COMPUTER PRACTICES LABORATORY I
#include<conio.h>main(){
int f1=-1,f2=1,f3,n,i;clrscr();printf("Enter the limit :");scanf("%d",&n);if(n<3){
printf("0");printf("\n1");
}else{
for(i=1;i<=n;i++){
f3=f1+f2;f1=f2;f2=f3;printf("\n%d",f3);
}}
getch();
}
Output:
Enter the limit: 7
The series is….0112358
Result:Thus the program for Fibonacci series is executed and the required output is
obtained.
SWITCH CASE
Computer Science & Engineering Page 33
COMPUTER PRACTICES LABORATORY I
Aim:
To write a C program to perform the operations below:
Prime or not.
Reverse of the number.
Fibonacci Series for the limit.
Algorithm:
1. Open a new file
2. Get the number from the user.
3. Gets the choice of operation from the user as input using CASE.
4. Perform the appropriate operation on the given number.
5. Print the result.
Flowchart:
Computer Science & Engineering Page 34
A B
AB
C
COMPUTER PRACTICES LABORATORY I
Coding:
#include<stdio.h>
#include<conio.h>
void main()
{
int f1=-1,f2=1,f3,n,ch,i;
clrscr();
printf("Enter the value of n: ");
scanf("%d",&n);
printf(“1.Prime or Not\n2.Reverse of the number\n3.Fibonacci Series\
n4.Exit”);
q:printf("Enter your choice");
scanf("%d",&ch);
switch(ch)
{
case 1:
if(n<2)
Computer Science & Engineering Page 35
C
C CSTOP
COMPUTER PRACTICES LABORATORY I
printf("the no is prime");else{
for(i=2;i<n;i++){
if(n%i==0)f=1;break;
}if(f==0)
printf("the no is prime");elseprintf("the no is not prime");
} break;case 2:
while(n>0)
{a=n%10;n=n/10;printf("%d",a);
}
break;
case 3:
if(n<3) {
printf("0");printf("\n1");
}else{
for(i=1;i<=n;i++){
f3=f1+f2;f1=f2;f2=f3;printf("\n%d",f3);
}}
break;
case 4:
exit(0);
Computer Science & Engineering Page 36
COMPUTER PRACTICES LABORATORY I
default:
printf(“Enter the Correct Choice:”);
goto q;
}
getch();
}
Output:
Enter the value of n: 13
Enter your choice: 1
The no is prime.
Result:
Thus the program is executed to perform the above operations and the output is
verified successfully.
SEARCHING AN ELEMENT IN AN ARRAY
Computer Science & Engineering Page 37
STOP
START
READ n, a[]
COMPUTER PRACTICES LABORATORY I
Aim:To write a C program to search a element in a array.
Algorithm:1. To open a new file.2. Get a n number of elements from the user and store it in a array3. Get a element to be searched in the array form the user 4. Search a that particular element in the array by using the for loop.5. print the result.
Flowchart:
Coding:
#include<stdio.h>
Computer Science & Engineering Page 38
COMPUTER PRACTICES LABORATORY I
#include<conio.h>main(){
int a[15],n,e,i,f=0;clrscr();printf("Enter the number of elements :");scanf("%d",&n);printf("Enter the elements.....");for(i=0;i<n;i++)
scanf("%d",&a[i]);printf("Enter the element to search :");scanf("%d",&e);for(i=0;i<n;i++){
if(e==a[i])f=1;
}if(f==1)
printf("%d is found",e);else
printf("%d is not found",e);
getch();}
Output:Enter the size of the array: 6Enter the elements….123456Enter the element to search: 66 is available in the array
Result:Thus the program for searching a element in the array is executed and the required
output is obtained.
MATRIX ADDITION
Computer Science & Engineering Page 39
start
Read row, col
for(i=0;i<row;i++)
for(j=0;j<col;j++)
Read a[i][j]
A
B
for(i=0;i<row;i++)
COMPUTER PRACTICES LABORATORY I
Aim:To write a C program to perform matrix addtition.
Algorithm:1. To open a new file.2. Initialize the matrix3. Get the input matrix from the user4. Perform the matrix addition5. Print the output.
Flowchart:
FLOWCHART FOR MATRIX ADDITION
Computer Science & Engineering Page 40
C
COMPUTER PRACTICES LABORATORY I
Coding:
#include<stdio.h>
Computer Science & Engineering Page 41
for(j=0;j<col;j
for(i=0;i<row;i
Print c[i][j]
Stop
C
C
for(j=0;j<col;j
for(i=0;i<row;i++)
c[i][j]= ai][j]+b[i][j]
C
C
COMPUTER PRACTICES LABORATORY I
#include<conio.h>main(){
int a[3][3],b[3][3],c[3][3];int i,j;clrscr();printf("Enter the elements of matrix A...");for(i=1;i<=3;i++){
for(j=1;j<=3;j++){
scanf("%d",&a[i][j]);}
}printf("Enter the elements of matrix B...");for(i=1;i<=3;i++){
for(j=1;j<=3;j++){
scanf("%d",&b[i][j]);}
}for(i=1;i<=3;i++){
for(j=1;j<=3;j++){
c[i][j]=a[i][j]+b[i][j];}
}printf("The result is.........");for(i=1;i<=3;i++){
for(j=1;j<=3;j++){
printf("\n%d",c[i][j]);}
}getch();
}
Output:Enter the matrix A:
Computer Science & Engineering Page 42
COMPUTER PRACTICES LABORATORY I
1 2 31 2 31 2 3
Enter the matrix B:1 2 31 2 31 2 3
The resultant matrix is…..2 4 62 4 62 4 6
Result:Thus the program for matrix addition is performed and the required output is
obtained.
STRING CONCATENATION
Aim:
Computer Science & Engineering Page 43
COMPUTER PRACTICES LABORATORY I
To write a C program to perform a string concatenation.
Algorithm:1. To open a new file.2. Get a two strings from the user.3. To find the length of the string by using strlen() function.4. To concatenate that strings 5. Print the output.
Flowchart:
Coding:
#include<stdio.h>#include<conio.h>
Computer Science & Engineering Page 44
COMPUTER PRACTICES LABORATORY I
#include<string.h>void main(){
int a,b,c;char i,j;char s1[10],s2[10],s3[10];clrscr();printf("Enter the first string :");scanf("%s",s1);printf("Enter the second string :");scanf("%s",s2);a=strlen(s1);b=a+strlen(s2);for(i=0;i<a;i++)
s3[i]=s1[i];for(i=a;i<=b;i++)
s3[i]=s2[i-a];printf("\n\nAfter the concatenation:");printf("%s",s3);getch();
}
Output:
Enter the first stringUNITED INSTITUE
Enter the second stringOF TECHNOLOGY
Then the resultant string is…..UNITED INSTITUE OF TECHNOLOGY
Result:Thus the program for string concatenation is performed and the required output is
struct student roll no: integer name[30]: character mark 1, mark 2mark 3, : integer
for(i=0;i<=n;i++)
Read n
start
COMPUTER PRACTICES LABORATORY I
Aim:To write a C program to display the student information by using structures.
Algorithm:1. To open a new file.2. Get a student information from the user.3. To get the input query from the user4. Based on the user’s query reterive the information.5. Print the output.
Flowchart:
Coding:
Computer Science & Engineering Page 46
COMPUTER PRACTICES LABORATORY I
#include<stdio.h>#include<conio.h>void main(){
struct student{
int rollno;char name[10];int mark1;int mark2;int mark3;
}stu[35];int n,i;clrscr();printf("Enter the number of student :");scanf("%d",&n);printf("\n\nEnter the student's roll no, name and marks...");for(i=1;i<=n;i++){