Escolar Documentos
Profissional Documentos
Cultura Documentos
COMPUTERS LAB
II Semester, BTECH
[common to all Branches]
(January 2013)
LA B M A N U A L
I N S T R U C T I O N S
T O
S T U D E N T S
1. Students should be regular and come prepared for the lab practice.
2. In case a student misses a class, it is his/her responsibility to complete that missed
experiment(s).
3. Students should bring and maintain an observation book exclusively for the lab.
4. Once the experiment(s) get executed, they should show the program and results to the
instructors and copy the same in their observation book.
5. Students are also required to draw the corresponding flowcharts in the observation book
during the lab hours itself which will be evaluated.
Flowcharts need not be drawn for the programs from week 7(Arrays).
Prescribed textbook and class notes can be kept ready for reference if required.
6. They should implement the given experiment individually.
7. While conducting the experiments students should see that their programs would meet the
following criteria:
Programs should be interactive with appropriate prompt messages, error messages if any,
and descriptive messages for outputs.
Programs should perform input validation (Data type, range error, etc.) and give
appropriate error messages and suggest corrective actions.
Comments should be used to give the statement of the problem and every function should
indicate the purpose of the function, inputs and outputs
8. Copying programs/lab work blindly from other students or yesteryears is strictly prohibited
and will fetch penalty for lab evaluation.
9. Questions for lab tests and exam need not necessarily be limited to the questions in the
manual, but could involve some variations and / or combinations of the questions.
* Above-mentioned instructions can be modified based on the context of the lab.
2|Page
MO D E O F E V A L U A T I O N
3|Page
C O N T E N T S
WEEK NO
TITLE OF EXPERIMENT
1.
2.
MS-WORD (BASICS)
3.
4.
5.
6.
7.
8.
1-D ARRAYS
9.
2-D ARRAYS
10.
STRINGS
11.
FUNCTIONS
12.
13.
14.
REFERENCES / TUTORIALS
ADDITIONAL EXERCISES
Department of Computer Science & Engineering
4|Page
1. NAME:
Insert a
picture from
clipart
2. FATHERS NAME:
3. DOB:
4. REG NO:
5. PERMANENT ADDR:
6. ACADEMIC PERFORMANCE:
Slno
1.
2.
F O R M A T
Name of school/college
St Anthonys
..
Class
10th
.
Percentage
78%
.
S P E C I F I C A T I O N S
5|Page
Mail Merge
You wish to send information about a new web-authorizing tool developed by your company
to the prospective clients. Create a new document of about 6 to 10 line describing the
product. Create a data of source file with fields as first name, last name, company and city.
Enter the data for 4 5 clients. Merge the main document with this data file to create a new
document. View the new document.
Paragraph Formatting
Following is an exercise in formatting paragraphs. Before you start you may need to change
the ruler from inches to centimeters. You can do this by selecting Options from the Tools
menu and then selecting the general tab. Then select centimeters from the measurement
units drop down list. (Remember to use Edit / Undo if you make a mistake.) Consider a
paragraph given below.
Before starting, check that you are viewing this in Microsoft Word. If you left clicked on
the link in your web browser to come here, you will be viewing this through Internet
Explorer. You can check this by clicking on the Help menu and seeing if it lists either
About Microsoft Word or About Internet Explorer.
Explorer you have opened this fine in the incorrect way, and so you can use the Back
button on the browser to go back and download the document in the correct way. If it
says About Microsoft Word, youve done it correctly carry on.
Format the above paragraph in the following ways:
a) The left and right margins are to be brought in by 1 cm from the page margins.
(Hint: First of all Click somewhere in this paragraph to make sure you are in the
correct paragraph. The easiest way to do this is to move the lower triangular shape
on the left hand side of the ruler in to 1cm and the triangle on the right into 13.6cm.
)
b) Set a hanging indent
(Hint: This can be done by moving the upper left triangle
on the ruler.)
Letter Writing
Write a letter to your friends (more than one) containing information regarding your home
town. The letter should include the followings
A table containing information such as area, population, distance from capital city etc.
Photos of historical places in your home town (Refer sample pictures available on your
computer) and
Relevant details (lines of text) about the place with necessary font and format.
Department of Computer Science & Engineering
6|Page
Format this line as Bold, Italic, Arial font face, dark blue color and 15pt font size.
Format this sentence so that the words, and not the spaces between the words, are
underlined.
Format this sentence to reduce the amount of space between each letter by 1 point.
Format the following line so that it is Bold, font size 28 with Kerning turned on.
Create a datasheet containing the data about students: roll no, name, subject wise marks
Calculate the total marks & Average of each student. Use functions.
Draw the bar chart for the above table, make changes to the cell values & observe the
changes in the chart.
Problem-2
Create a table containing the following information.
Itemcode, Qty, Price, Sales, Commission and remarks
Enter 5 suitable records into the above table then compute the following.
Total Sales
Highest Sales
Lowest Sales
Average Sales
Show item wise sales display using bar chart, Line graph, Pie Chart.
7|Page
M S - P O W E R P O I N T
Problem-1
You are the leader of a software development team & your team wants to develop a new
software product. You are required to make a presentation about this product to the
management. Develop a power point presentation consisting of the following slides
Development team
In each box, fill suitable names titles & comments (examiners can ask you to change the style,
levels, box properties & text inside the boxes for this chart)
Slide 4: A pie chart showing the breakup of the project development cost.
Use Excel for entering suitable values & for creating the pie chart. Link this chart to slide 4.
Demonstrate the concept of object linking by showing that when the data in the Excel
spreadsheet is changed: the contents of this slide also change automatically.
Run the slide show with the 4 slides created in the preceding steps
(Examiners/Instructors can ask to change the slide transition effect, standard transition sound
effect and design for all the slides)
Problem-2
Use Power point presentation to demonstrate the work you have done till now in this session. (At
least 4 slides)
8|Page
Lab 4: RAPTOR
Draw flowcharts for each of the following algorithm using RAPTOR tool
Perform the four basic arithmetic Operations [e.g. sum=a+b; diff=a-b; prod=a*b;
quot=a/b]
Convert the time in seconds to hours, minutes and seconds. (1 hr =3600 sec).
Find the sum of the digits of a 3-digit number [ex 123 sum=6](no looping).
Menu Bar
Simple Programs
Program to find the volume and surface area of sphere (given in radius)
(Hint: volume=(4r3)/3, Area=4r2).
Program to perform the four basic arithmetic Operations [e.g. sum=a+b; diff=a-b;
prod=a*b; quot=a/b]
Convert the time in seconds to hours, minutes and seconds. (1 hr =3600 sec).
Find the sum of the digits of a four-digit number (ex 1234 sum=10).
9|Page
Write a C++ program to find square and cube value of a 2 digit odd number
Write a C++ program to show the greatest number between three numbers using IF-ELSEIF statement.
Write a C++ program to illustrate bitwise OR, AND and X-OR operations on 2
binary numbers.
Write a C++ program to illustrate LEFT and RIGHT shift operations on a binary
number.
Write a C++ program to illustrate LOGICAL and RELATIONAL expressions on 2
binary numbers.
Write a C++ program to check whether given number is zero, positive or negative using
IF-ELSEIF-ELSE statement
1 2 3
4 5 . K
2 4 6
8 10 ..2*k
..
n .. nK
Evaluate the sin series sin x= x - x3 /3! + x5 /5! x7 /7! + to n terms.
Write a program that examines all the numbers from 1 to N, displaying all those for
which the sum of the cubes of all the digits equals the number itself.
10 | P a g e
Arrange the elements of an array in ascending order by simple sorting method. (Selection
sort / bubble sort)
Insert an element into a sorted array (new array should be sorted one).
Two sets are represented by arrays A and B. Find AUB, A^B and A-B.
Searching for an element in the matrix and counting the number of its occurrences.
Write a C++ program which toggles the case of every character in the input string
(Eg: INPUT: aBcDe OUTPUT:AbCdE)
Write a C++ program to mask password with *.
Write a C++ program which deletes a word from the given sentence. (Eg: INPUT: I AM
STUDYING IN MIT, TO BE DELETED: STUDYING, OUTPUT: I AM IN MIT)
11 | P a g e
Write a function to check whether the given number is prime or not. Generate first n
prime numbers using the above function.
Write a function to generate nth Fibonacci term using recursion. Print first N Fibonacci
terms using this function.
Hint: (fibonacci series is 0, 1, 1, 2, 3, 5, 8,)
Check if the given string is a palindrome or not, using string handling function.
Write a function Sort for sorting a list of names which will use a function compare to
compare two names. (Selection /bubble Sort may be used).
Define a structure type, personal that would contain person name, date of joining and
salary.
Using this structure write a program to read this information for one person
Create an array of student structure to store the roll no., name and marks in 3 subjects.
Input the details of N students in to the array and display roll no., name, and total marks
of each student in decreasing order of total marks.
P OINTERS
Compute the sum of all elements stored in an array using a pointer to an array.
12 | P a g e
FILES
Write a program to read a sentence from a file and display the same on the screen
Write a program to copy the contents of one file into another file.
13 | P a g e
REFERENCES / TUTORIALS
Programming in ANSI C E. Balaguruswamy
Object Oriented Programming in C++ - E. Balaguruswamy
Herbert Schildt, C++: The Complete Reference 4th edition - Tata McGraw-Hill.
Robert LaFore, Galgotia Object Oriented Programming with Turbo C++ - Publications,
2002
. P r o g r a m m i n g i n C , P r a d i p D e y a n d M a n a s G h o s h , S e c o n d E d i t i o n ,
Oxford University Press, 2011
ADDITIONAL EXERCISES
1) Write a program to find the determinant of a square matrix.
2) Write a program to check whether a saddle point exists in a given matrix.(i.e element
which is minimum in row and maximum in column)
3) Write a program, which generates all the possible combinations of a 3-digit number.
4) Given a list of N numbers in the range 1 to N (not necessarily in the order) and out of that
one number is missing (i.e. only N-1 inputs), write a program to find the missing number.
5) Write a program to find the time of the day when
a) Hour and Minute hand are exactly opposite to each other.
b) Hour and Minute hand are overlapping each other.
6) Given 4 numbers 1,2,3 and 4. Find all possible 4-digit numbers that can be formed using
these 4-digits. From these numbers, generate the permutation of the 4 digits (i.e. 4 digits
are distinct)
7) Write a program to find the median of N numbers.
8) Write a program to check whether the given number is Armstrong Number.
9) Create an array of employee structure to store emp-no, name, basic salary and hra. Input
the details of N employees and display emp-no, name, basic, hra and net salary. Display
the details of all employees whose net salary is more than the average net salary of all
employees.
10) Input N numbers and place only those numbers whose Pth position (specified by user) is
divisible by 3 into an array. (Eg: The numbers input : 1223, 1243, 1232; position P=4
(left to right) then the resultant array will {1223,1243})
11) A number has all its digits squared and added together to make a new number. This
process is repeated until a 1 is obtained, then the original number is described as
Department of Computer Science & Engineering
14 | P a g e
HAPPY. If a 1 is never obtained, then the original number is said to be SAD. { eg.:
19 = 12+92= 82=> 82+22 =68=>62+82 =100=>12=1}
12) Write a program to delete blanks from a given string.
13) Write a program to display following output for N number of lines.
1
14) Find the inverse of a matrix A.
15) Find the solution to the system of simultaneous equations using Guass- Jordan
elimination method.
16) Display the list of perfect squares in the given mXn matrix.
17) Given a string S1=This is a way to do this and a string S2=is find the positions of
occurrence of S2 in S1.
18) Replace odd numbers in a matrix by zeroes.
19) Display all the Pythagorean triplets up to n. (Eg: 32+42 = 52 ).
20) Write a program to find the transpose of a matrix without using another matrix.
21) WAP to print the abbreviation of a given name. (Eg: Central Computing Facility =>
C.C.F)
22) WAP to simulate an arithmetic calculator.
23) Replace each element of the matrix by its factorial.
24) Find the odd numbers in a given matrix and display its row and column number.
25) Convert 3X3 matrix to a 4X4 matrix.
Eg: Original Matrix:
1
18
New Matrix:
15 | P a g e
26) WAP to print all combinations of a given word. (Eg: Rose => oser, osre. Etc)
27) Write an n digit number in words.( 236=two three six)
28) Find the volume of a cylinder and a cube.
29) Find the LCM of two numbers.
30) Find all the primes in the multiplication tables ranging from 2 to 5 and store them in array
without having duplicates.
31) Check all the rows, columns, principal diagonal, and secondary diagonal for palindromes
in an integer matrix of any order.
32) WAP to find the digital roots of numbers for multiplication tables ranging from 2 to 5 and
store those forty resultant numbers in a matrix of order 4X10. (Digital root of number is
a single digit derived from adding all the individual digits of the number repeatedly. (Eg:
digital root of 2456= 2+4+5+6=17, again 1+7=8---> digital root)
33) Generate
1
1
1
1
1
2
1
3
1
4
34) Write a program to read a line, encode the line and display the original and encoded form.
The encode should be:
a
c d .. z
x w . a
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16 | P a g e