lab manual ge2115

Upload: sansayana

Post on 14-Jul-2015

471 views

Category:

Documents


0 download

TRANSCRIPT

Manualon

Page 1 of 28

PART A Exercise No. 1. a) Create a document using a suitable word processing package, like MS Word, with at least three paragraphs and perform the following operations: (i) Set left margin 1 and right margin 0.75 (ii) Centre the heading and make it bold. Increase the font size (iii) Underline the specified words in the document and change them to italics (iv) Conduct spell check and correct them suitably (v) Demonstrate use of numbering and bullets (vi) Exchange paragraphs 2 and 3 using cut and paste facility (vii) Put suitable headers and footers (viii) Count the number of words and lines (ix) Demonstrate use of drawing tools (x) Include suitable logo/emblem/symbol b) Create a interview call letter as the main document and create 10 records for 10 persons. Use mail merge to create letter for 6 selected persons among 10. Exercise No. 2.a) Create a formal letter using a suitable word processing package, like MS Word, to place a purchase order for procurement of books, having the following information.

b) Draw the graph for Number of copies purchased in every year, where take Purchase order Year in X axis and Number of copies in Y axis. Exercise No. 3 Create a suitable examination database and find the sum (total) of the marks of each student and the respective classes secured by the students Rules 1. 2. 3. 4. 5. 6. PASS if marks in the each subject >= 35 FAIL if marks in any subject is < 35 Distinction if average >= 75 First class if average = 60 but less than 75 Second class if average =50 but less than 60 Third class if average >= 50

Display average marks of the class subject wise and pass percentage and draw all possible graphs.

Page 2 of 28

Exercise No. 4. Calculate HRA, DA, TA, PF, GPF, LIC, Gross salary, Deductions, Net salary form given data in a worksheet EN O 5 1 2 4 3 7 6 Where HRA is 18% of BASIC DA is 50% of BASIC TA is 12% of BASIC PF is 10% of BASIC GPF is 5% of BASIC LIC is 7% of BASIC GS (Gross salary) = BASIC + HRA + DA + TA. DD (Deductions) = PF + GPF + LIC NS (Net Salary) = GS-DD. Sort all employee name in alphabetical order. ENAM E Veena Kuma ri Geeth a Anu Pavit hra Jeeva n Periya r BASI C 3000 2000 5000 0 7000 3400 2040 4000 HR A T A D A LI C P F GP F G S DE D NET

Page 3 of 28

Exercise No 5 : Write a C program to find all roots of the quadratic equation for non-zero co-efficient#include #include main() { int a,b,c; float root1, root2, realp, imgp, disc; clrscr(); printf("Enter three co-efficients of the quadratic equation\n"); scanf("%d%d%d", &a,&b, &c); if(a==0 || b==0 || c==0) { printf("Roots can not be found"); getch(); exit(0); } disc = b*b-4*a*c; if(disc==0) { printf("\nRoots are equal"); root1 = root2 =-b/(2.0*a); printf("\nRoot1 = Root2 = %.2f", root1); } else if(disc>0) { printf("\nRoots are real and distinct"); root1 = (-b + sqrt(disc))/(2*a); root2 = (-b - sqrt(disc))/(2*a); printf("\nRoot1 = %.2f", root1); printf("\nRoot2 = %.2f", root2); } else { printf("\nRoots are imaginary"); realp = -b/(2.0*a); imgp = sqrt(fabs(disc))/(2*a); printf("\nRoot1 = %.2f + i %.2f",realp, imgp); printf("\nRoot2 = %.2f - i %.2f",realp, imgp); } getch(); }

Page 4 of 28

Exercise No 6 : Write a C program to simulate a simple calculator to perform arithmetic operation such as addition, subtraction, multiplication and division. Flow ChartStart Read two num bers n1,n2

Read an operator 'op'

is (op == ?)

+

-

*no

/yes

result = n1+n2

result = n1- n2

result = n1 * n2

is (n2 = = 0)

result = n1/ n2

Display 'Division by zero error'

Display result

Stop /* Write a C program to simulate a simple calculator that performs arithmetic operations like addition, subtraction, multiplication, and division only on integers. Error message should be reported, if any attempt is made to divide by zero. (Using switch statement) */ #include #include main() { float num1,num2, result; char op; clrscr(); printf("Type your expression(num1 op num2)"); scanf("%f %c %f", &num1,&op,&num2); switch (op) { case '+':

Page 5 of 28

case '-': case '*': case '/':

result = num1+num2; break; result = num1-num2; break; result = num1*num2; break; if (num2 == 0) { printf("\nDivision by zero error"); } else { result = num1/num2; } break;

default:

}

printf("\nInvalid operator"); } printf("\n%.2f %c %.2f = %.2f", num1,op, num2, result); getch();

Page 6 of 28

Exercise No 7 : Write a C program generate n Fibonacci numbers Flow ChartStart Read n f1 = 0, f2 =1 output f1, f2 for ( i =0, i