CSC401 - Milestone2 - Stud - Copy 1
CSC401 - Milestone2 - Stud - Copy 1
Learner
Grade Programming – Grade 09
Name
617761 NQA Registration
ATHS ID
#
Unit: Write a simple computer program that includes a print statement and a comment
Assessment writer
Learner’s declaration
I certify that the work submitted for this assignment is my own. I have clearly referenced any
sources used in the work. I understand that false declaration is a form of malpractice.
2.1- Created an if block structure, implementing appropriate Boolean and relational operators, using the correct
syntax, and determine the output of a code
2.2- Branched an if statement using if-else when the condition evaluates to False and find the output of a code
2.3- Distinguished when it is appropriate to use an if-else and nested if statements and implement them correctly
within the code
2.4- Used cascaded if statements using if-elif-else and find the output of a code based on the given problem
algorithm/statement
2.5- Adhered to indentation format when constructing the if , if else, if elif else structure
Notes:
• The instructor has the right to change or modify the assessment questions as long as he/she
is fulfilling the specification of the listed Performance Criteria.
• If the instructor changes the questions, they have to be verified by an assessor.
Assessor’s approval
• When uploading the assessments to your ePortfolio, please follow the evidence naming
convention
Assessor’s (Teacher) Name: Signature: Date: 26/5/2024
Question 1:
1- Create a program based on the provided pseudocode.
Add a screenshot showing your code & output.
Ask the user to enter a number
Read the entered number
If the entered number is greater than 0 then
Display "The number is positive"
End If
if number > 0:
print ( The number is positive)
if number > 0:
print ( The number is positive)
if number > 0:
print ( The number is positive)
2- Write a Python program that verifies if a user is eligible to participate in a game,
considering an age requirement of 13 or older. If the user meets the criteria, output the
message "You are eligible to play!"
Add a screenshot showing your code & output.
Code:
age = int(input(Enter your age))
Whole
Question 2:
1- Complete the Python program that asks the user if they are a member of a club. If the user
responds "yes", print "Welcome to the club!" otherwise, print "Considering joining our
club."
if membership_status == "yes":
print("Welcome to the club!")
else:
# Your completion here
print("Considering joining our club.")
Code:
temp = float(input(Enter the temperature))
Code:
number = int (input (Enter a number))
if number
1- Develop a Python program that compares two user-input numbers, and determines, and
displays the larger of the two.
Add a screenshot showing your code & output.
3- Organize the given NESTED IF statement into the correct order by providing the accurate
program code ANSWER. Ensure the proper format and indentation are followed.
if isGraduated:
print('Congratulations with your graduation!')
age = 19
isGraduated = False
if hasLicense:
print('Happy driving!')
hasLicense = True
if age >= 18:
print("You're 18 or older. Welcome to adulthood!")
[This provides evidence for PC 2.3]
Question 4:
Sequential evaluation of conditions where only first true conditional is executed leading to a
cascading effect in decision-making. T
2- Identify the following output of CASCADED If statement using IF – ELIF – ELSE. Write the
answer on the given space.
a)
number = 0 Answer:
Zero
if number > 0: This statement is always executed.
print("Positive number")
b)
3- Create a Nested IF Python program that will check your marks. Use the pseudocode below
to complete your task.
if marks >=90:
print (Excellent)
else:
print(Excellent)
if marks>=80
print(Good job)