SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY
COMPUTER SCIENCE & INFORMATION TECHNOLOGY DEPARTMENT
Fall 2023
Programming Fundamentals (CS-116T)
Assignment # 1
Semester: 1st Batch: 2023F
Announced Date: 06-11-23 Due Date: 13-11-23
Total Marks: 30
CLO # Course Learning Outcomes PLO Mapping Bloom’s Taxonomy
(CLOs)
Describe basic problem-solving PLO_2
C2
CLO 1 steps and logic constructs. (Knowledge for solving
(Understanding)
Computing Problem)
Q1. Discuss how programming errors can be classified into three distinct types: syntax errors, runtime
…...errors, and logic errors, and explain the key characteristics of each. Provide a Python code snippet
…...that demonstrates each of these error types.
Q2. Rewrite the following Python code to convert it into the preferred format for handling multiple
……alternatives.
# Prompt the user to enter weight in pounds
weight = eval(input("Enter weight in pounds: "))
# Prompt the user to enter height in inches
height = eval(input("Enter height in inches: "))
KILOGRAMS_PER_POUND = 0.45359237 # Constant
METERS_PER_INCH = 0.0254 # Constant
# Compute BMI
weightInKilograms = weight * KILOGRAMS_PER_POUND
heightInMeters = height * METERS_PER_INCH
bmi = weightInKilograms / (heightInMeters * heightInMeters)
# Display result
print("BMI is", format(bmi, ".2f"))
if bmi < 18.5:
print("Underweight")
else:
if bmi < 25:
print("Normal")
else:
if bmi < 30:
print("Overweight")
else:
print("Obese")
Q3. Identify and list some common built-in Python functions that are frequently used within for loop
…...scenarios for data processing and manipulation.
Page 1 of 1