Skip to content

Computer Programming Lab

CE · Final · Spring 25

Section BN21

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University B. Sc. in Civil Engineering Final Examination, Spring - 2025 Course Code: CSE 202 Course Title: Computer Programming Lab Section: BN21 Level-Term: 2-1 Teacher's Initial: SNA Full Marks: 40 Date: May 28, 2025 Time: 2.0 Hours Right margin indicates full marks. Answer all the questions in google colab notebook. 1. a). Assign the following data in a DataFrame using a dictionary [CO1, C2] [02] Names: Alice, Bob, Charlie, David Marks: 85, 90, 95, 88 b). Add a new column called "Grade" based on the following: [CO1, C2] [05] If Marks >= 90 -> 'A' 80 <= Marks < 90 -> 'B' Else -> 'C' c). Display only the students who got an A. [CO1, C2] [03] 2. A fixed beam of length L = 6 + 0.5*sin(last_two_digit_of_student_id) m is subjected to a uniformly distributed load w = 10 kN/m along its entire length. The beam has a constant flexural rigidity EI = 2 x 10^7 kN/m^2 [Figure: A fixed-end beam of length L under a uniformly distributed load w with deflection y(x) at distance x] Figure 1 The deflection curve of the beam under this loading can be given by the formula: y(x) = -(w / (24EI)) * (x^4 - 2Lx^3 + L^2x^2) where: - y(x) is the vertical deflection at distance xxx from the left support (in meters), - EI is the flexural rigidity (in kN-m^2), - w is the uniformly distributed load (in kN/m), - L is the span length (in meters). Demonstrate a plot in python that shows deflection of the beam. [CO3, C2] [10] 3. The following data defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T (°C) | 0 | 8 | 16 | 24 | 32 | 40 DO (mg/L) | 14.621 | 11.843 | 9.870 | 8.418 | 7.305 | 6.413 a). Demonstrate a linear regression model to predict DO level based on temperature. [CO3, C2] [05] b). Show the model in a plot along with the given data points in scatter plot. [CO3, C2] [05] c). Determine dissolved oxygen for fresh water for 18 degree Celsius temperature. [CO3, [03] C2] 4. Apply a for loop to calculate the sum of given series. [CO2, C3] [07] S = 1*2*3*4 + 5*6*7*8 + .......... + 21*22*23*24