0% found this document useful (0 votes)
25 views

Assignment 1

This document provides the details of Programming Fundamentals (CS-116T) Assignment #1 for the 1st semester Batch of 2023 at Sir Syed University of Engineering & Technology. It includes 3 questions related to classifying programming errors, rewriting code to handle multiple alternatives, and identifying common Python functions used in for loops. Students must submit their responses by November 13, 2023 for a total of 30 marks.

Uploaded by

sadaankhan1258
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Assignment 1

This document provides the details of Programming Fundamentals (CS-116T) Assignment #1 for the 1st semester Batch of 2023 at Sir Syed University of Engineering & Technology. It includes 3 questions related to classifying programming errors, rewriting code to handle multiple alternatives, and identifying common Python functions used in for loops. Students must submit their responses by November 13, 2023 for a total of 30 marks.

Uploaded by

sadaankhan1258
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like