0% found this document useful (0 votes)
2 views1 page

Assignment 03

The document outlines an assignment for a Computer Programming course at The University of Lahore, focusing on C++ programming tasks related to Civil Engineering. Students are required to write functions to calculate concrete volume, material costs, column load, unit conversions, and the surface area of a pipe. The assignment is due on April 29, 2025, and emphasizes the importance of neat diagrams and analysis of results.

Uploaded by

zaynjabbar057
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Assignment 03

The document outlines an assignment for a Computer Programming course at The University of Lahore, focusing on C++ programming tasks related to Civil Engineering. Students are required to write functions to calculate concrete volume, material costs, column load, unit conversions, and the surface area of a pipe. The assignment is due on April 29, 2025, and emphasizes the importance of neat diagrams and analysis of results.

Uploaded by

zaynjabbar057
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DEPARTMENT OF CIVIL ENGINEERING

The University of Lahore


1 - KM Defence Road, Lahore

================================================
Subject: Computer Programming Course Code: CS02148
Time Allowed: 1 week Max Marks: 10
Examination: Assignment 03, Spring 2025 Student Name:
Due Date: 29-04-2025 Reg. No.:
================================================
Note:
Draw neat and clean labeled diagrams where necessary.
================================================

Question # 1: [CLO2, C4] (10)

By writing the functions in Computer Programming using C++, find the solutions of the
given task related to Civil Engineering. Also analyze the results and find the major factor
that can change the results.

a) Write a C++ program by creating a function that calculates the volume of concrete.
[Hint: Volume = length × width × thickness (in cubic meters)]
b) Write a C++ program by using a function that calculates the total cost of Materials.
Use this function to:
- Calculate the cost of concrete
- Calculate the cost of steel
c) Write a C++ program by using a function to calculate load on a Column
[Hint: Load = area × height × density (kg)]
d) Write a program by using functions that can calculateUnit Conversion (Meters ↔ Feet)

Write two functions:


- `float metersToFeet(float meters)`
- `float feetToMeters(float feet)`
Allow user to convert between the two units.

e) Write a C++ program by applying a function that calculates the surface area of a pipe.
[Hint: Surface area = π × diameter × length
Use `#define PI 3.1416` or `const float PI = 3.1416`]

You might also like