Kerala University 2009-1st Sem B.Tech Vester ,, Branch : Chemical Engineering, Lab : SOFTWARE ENGINEERING LAB(H) P - Question Paper
iiiiiiiiiiii iiiiiiiiiiii (Pages : 3) 3834 A (H) P
Reg. No. : Name :.....
VI Semester B.Tech. Degree Examination, June 2009 Branch : Chemical Engineering Lab : SOFTWARE ENGINEERING LAB(H) P
Time : 3 Hours Max. Marks : 100
1. a) Write a C++ program to create a file stcok.dat and save the details of stock
such as item name, item code and item price. Calculate the area of a sphere, rectangle and triangle using a single function named area. Use the function verloading concept of C++. Run the program and show the result for the given input values.
b) Compute the y-coordinates of a straight line with slope equal to 0.5 and intercept equal to - 2, using MATLAB at the following x values x = 0, 1.5, 3.0, 4, 5, 7, 9, 10.
2. a) Write a C++ program to perform arithmetic operations on two complex numbers
using the concept of class.
b) Use MATLAB to draw a straight line with slope 0.3 and intercept = 5, choosing values of x-coordinate as [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
3. a) Write a menu driven program for performing basic banking operations using
concept of class.
b) Using Matlab create a vector t with 15 elements : 2, 4, 6, 8,........., 30 and
compute :
t -1 Sin(t2)
a) y b)
Z :
2
t + 1 t
4. a) Write a program in C++ to overload the operator for scalar multiplication of a vector.
b) The sum of a geometric series 1 + r + r2 +r3 +.........+ rn approaches the limit.
1
-for r < 1 as n . By creating vector n of 101 elements from 0 to 100
1 - r
and r as 0.5, find the sum of the geometric series using sum command in Matlab.
1
Also calculate the limit-manually and compare the computed sum.
1-r
5. a) Write a program in C++ to sort a given string.
b) Plot y = sin x, 0 < x < 2 n, using Matlab taking 100 linearly spaced points in the given interval. Label the axis and put Plot created by your candiate code in the title.
6. a) Write a program to multiply two matrices.
b) Write a function file in Matalab to plot a graph of y = e-0 4x sin x, 0 < x < 4 n taking 50 points in the interval.
7. a) Write a program in C++ to search for a given element in an array and display its
position.
b) For any integer n, write a function factorial in MATLAB to compute n!.
8. a) Write a program in C++ to swap two numbers using call by reference method
b) Write a function in Matlab that outputs a conversion table for Celsius and Fahrenheit temperatures. The input of the function should be two numbers T and Tf, specifying the lower and upper range of the table in Celsius. The output should be a two column matrix : the first column showing the temperature in Celsius from T to Tf in the increments of 1C and the second column showing the corresponding temperature in Fahrenheit.
9. a) Write a menu driven program in C++ for a four function calculator.
b) Enter the matrix G and do the following operations using Matlab
(N, |
6 |
0 |
0 |
0 |
0 |
3 |
9 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
2 |
0 |
0 |
0 |
0 |
3 |
4 |
0 |
0 |
0 |
0 |
0 |
0 |
- 5 |
5 |
0 |
0 |
0 |
0 |
5 |
3] |
10. a) Write a program in C++ to find the sum and average of n numbers using array.
b) Write a script file in Matlab that computes the value of sin (x) at a given x using n terms of the series expansion of the sine function
n 2k-1 n k-1 x
Sin(x) =1(-1) k=1 (2k -1)!
11. a) Write a program in C++ to add two matrices.
b) Find the solution of the following set of linear algebraic equations by Gaussian Elimination method with the help of Matlab. Verify the result by matrix inverse.
x + 2y + 3z = 1
3x + 3y + 4z = 1
2x + 3y + 3z = 2
12. a) Write a program in C++ using concept of class for performing basic string
operations.
b) Solve the first order linear differential equation dx
= x +1 with initial condition x (0) = 0. dt
Attachment: |
Earning: Approval pending. |