0% found this document useful (0 votes)
14 views3 pages

Aict 3

This document is an assignment for a Civil Engineering course focusing on Python programming. It includes tasks such as calculating stress, solving quadratic equations, predicting code output, and correcting errors in Python code. The assignment is due on June 25, 2025, and is supervised by Engr. Waseem A. Siddiqui.

Uploaded by

zohebgh87
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)
14 views3 pages

Aict 3

This document is an assignment for a Civil Engineering course focusing on Python programming. It includes tasks such as calculating stress, solving quadratic equations, predicting code output, and correcting errors in Python code. The assignment is due on June 25, 2025, and is supervised by Engr. Waseem A. Siddiqui.

Uploaded by

zohebgh87
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/ 3

ASSSIGNMENT OF

AICT

ROLL NO 2024 F -BCV -059

NAME ZOHAIB UL HAQ

SECTION B

COURSE SIR WASEEM A. SIDDIQUI


INSTRUCTOR
Roll No: 2024F-BCV-059 Section: B
Department: Civil Engineering Program: BS (CV)

ASSIGNMENT 03
CE-141T Applications of Information and Communication Technologies & Programming

Bloom’s
Sr. No. Course Learning Outcome PLO
Taxonomy
Apply the concepts of object-oriented paradigm. Rewrite PLO_2
C3
CLO 3 basic programs of I/O and control structures using python. (Problem Analysis)
Applying

Announced: 16 June 2025 Due: 2 5 J u n e 2025 Total Marks: 04


Obtained
Marks:
Teacher’s Name: Engr. Waseem A Siddiqui

Q1. Write a Python program to:

Take input for force (in Newtons) and area (in m²)

Calculate the stress using the formula:

 Stress=Force/Area

Print the result with units

Solution:

force = float(input("Enter force in Newtons: "))

area = float(input("Enter area in square meters: "))

stress = force / area

print("Stress:", stress, "N/m²")

Q2: Write a Python program to:

Solve a quadratic equation of the form: ax² + bx + c = 0

Take values of a, b, and c as input from the user

Use the math module to calculate the two real roots and display them

Solution:

import math

a = float(input("Enter a: "))

b = float(input("Enter b: "))

c = float(input("Enter c: "))
discriminant = b**2 - 4*a*c

x1 = (-b + math.sqrt(discriminant)) / (2*a)

x2 = (-b - math.sqrt(discriminant)) / (2*a)

print("Roots are:", x1, "and", x2)

Q3: Predict the output of the following code

text = "CIVIL"

print(“text”)

print(text)

print(text[0])

print(text[2:5])

print(text[2:])

print(text * 2)

print(text + "ENGG")

Q4. The following Python code contains errors. Identify and correct them.

message = "ENGINEER"
print message
print(message + 2)

Solution:
message = "ENGINEER"
 print(message) ◇Add parentheses for print (Python 3 syntax)
 print(message + "2") ◇ Convert number to string before concatenation

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy