Assignment 1
Assignment 1
Assignment 1
CET-102T Programming Fundamentals
Question#01: Predict Python coding expressions of the following statements. (Assuming the
given variables is already having meaningful values):
i. Assign the values 100, 200, and 300 to the variables a, b, and c in a single statement.
ii. Assign the string "John" to the variable first_name and the string "Doe" to the
variable last_name in a single statement.
iii. Assign the concatenation of first_name and last_name to the variable full_name,
including a space between the two names.
iv. Check if the variable b is greater than a and less than c. Write the condition using a
single line.
v. Assign the values of 5 to x and 10 to y, and then compute the sum of x and y,
assigning the result to the variable total.
vi. Check if the variable num is neither less than 10 nor greater than 20. Write the
condition using a logical expression.
Question#02: Given a number as user input, distinguish if it is even or odd by answering the
following questions:
i. Write an algorithm to check if a user-inputted number is even or odd.
ii. Provide the pseudocode for this task.
iii. Draw a flowchart that illustrates the process of checking if a user-inputted number is
even or odd.
Note: Ensure the solution includes clear decision-making steps and prompts the user to input a
number.