0% found this document useful (0 votes)
53 views13 pages

CSC401 - Milestone2 - Stud - Copy 1

Here is the code for the nested IF statement program to check marks based on the pseudocode: marks = int(input("Enter your marks: ")) if marks >= 90: print("Excellent") if marks >= 95: print("Grade A+") else: print("Grade A") elif marks >= 80: print("Well done") if marks >= 85: print("Grade B+") else: print("Grade B") elif marks >= 70: print("Passed") print("Grade C") else: print("Failed") This program first checks if the marks are greater than or equal to 90. If yes, it prints "Excellent"

Uploaded by

nahyansaif838
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views13 pages

CSC401 - Milestone2 - Stud - Copy 1

Here is the code for the nested IF statement program to check marks based on the pseudocode: marks = int(input("Enter your marks: ")) if marks >= 90: print("Excellent") if marks >= 95: print("Grade A+") else: print("Grade A") elif marks >= 80: print("Well done") if marks >= 85: print("Grade B+") else: print("Grade B") elif marks >= 70: print("Passed") print("Grade C") else: print("Failed") This program first checks if the marks are greater than or equal to 90. If yes, it prints "Excellent"

Uploaded by

nahyansaif838
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Nahyan SAIF Code, Subject, CSC401 – Fundaments of

Learner
Grade Programming – Grade 09
Name
617761 NQA Registration
ATHS ID
#

Related NQC Unit and Performance Criteria:

Qualification: Certificate 3 in Applied Engineering

Unit: Write a simple computer program that includes a print statement and a comment

GC/ GC/PC Description Mark (tick as


PC# appropriate)
PC2.1 Create an if block structure, implementing appropriate Boolean 1 2 3 4 5*
and relational operators, using the correct syntax, and determine
the output of a code ☐ ☐ ☐ ☐ ☐
PC2.2 Branch an if statement using if-else when the condition evaluates 1 2 3 4 5*
to False and find the output of a code
☐ ☐ ☐ ☐ ☐
PC2.3 Distinguish when it is appropriate to use an if-else and nested if 1 2 3 4 5*
statements and implement them correctly within the code
☐ ☐ ☐ ☐ ☐
PC2.4 Use cascaded if statements using if-elif-else and find the output of 1 2 3 4 5*
a code based on the given problem algorithm/statement
☐ ☐ ☐ ☐ ☐
PC2.5 Adhere to indentation format when constructing the if , if else, if 1 2 3 4 5*
elif else structure
☐ ☐ ☐ ☐ ☐

∗ Only for First Submission


Rubric
Performanc
Scor Descripti
e Criteria
e on
Student’s work is meeting the requirements of evidence quality
5 against the criteria identified in the unit of competency, by no less
Achieved than 90%.
Student’s work is meeting the requirements of evidence quality
4 against the
criteria identified in the unit of competency, by no less than 80%.
Student’s work is meeting the requirements of evidence quality
3
against the
criteria identified in the unit of competency, by no less than 70%.
Student’s work is approaching towards meeting the minimum
2 requirements
NOT of the evidence quality to demonstrate competency. Work quality
Achieve must be
d improved to be acceptable.
Student submits evidence that lacks quality towards demonstrating
1 competency against the criteria identified in the unit of competency.
0 No evidence of completion submitted.

Assessment writer

Name: Hamza Khellifi Signature: Date: 02/01/2024

Assessment verifier’s approval

Verifier’s Name: Mohammad Qotate Signature: M.Qotate Date: 03/01/2024

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.

Learner’s signature: Date: 26/1/2024

Assessor’s Feedback to the learner

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

Learner’s Feedback about assessment decision

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

Code: number = int(input (Enter a number:))

if number > 0:
print ( The number is positive)

int(input (Enter a number:))

if number > 0:
print ( The number is positive)

int(input (Enter a number:))

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))

if age > =13:


print(you are eligible to play)

[This provides evidence for PC 2.1]

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."

membership_status = input("Are you a member of the club? (yes/no): ").lower()

# Your code here

if membership_status == "yes":
print("Welcome to the club!")
else:
# Your completion here
print("Considering joining our club.")

2- Create a Python program using the given pseudocode.


Add a screenshot showing your code & output.
Prompt the user to input the temperature
If the entered temperature exceeded 35, output "HOT"
Otherwise, output "COLD"

Code:
temp = float(input(Enter the temperature))

If temp > 35:


print(Hot)
else:
3- Write a python program that takes an integer as input and prints:

 "Even" if the number is even, and


 "Odd" if the number is odd.

Add a screenshot showing your code & output.

Code:
number = int (input (Enter a number))

if number

[This provides evidence for PC 2.2]


Question 3:

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.

number1=int (input (Enter number1))


number2=int (input (Enter num ber2))
2- What is a nested if statement?

It is an if statement within the body of another if statement. T

Within the body of another is statement is in if statement

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:

1- Explain the concept of ‘Cascade’ in the context of programming.

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)

price = 100 Answer:


Price is 100
if price > 100:
print("price is greater than 100")
elif price == 100:
print("price is 100")
elif price < 100:
print("price is less than 100")

3- Create a Nested IF Python program that will check your marks. Use the pseudocode below
to complete your task.

a) Ask the user to enter the marks.


b) If the mark is greater or equal to 90, Print “Excellent”.
c) Otherwise IF the mark is greater or equal to 80, Print “Good Job”.
d) Otherwise IF the mark is greater or equal to 70, Print “Satisfactory”.
Otherwise, Print “Needs improvement”
Add a screenshot showing your code & output.

marks = float (input (Enter your marks))

if marks >=90:
print (Excellent)
else:
print(Excellent)
if marks>=80
print(Good job)

[This provides evidence for PC 2.4, 2.5]

You might also like