0% found this document useful (0 votes)
6 views2 pages

A. Read The Following Questions and Write Your Answer On The File Document Given (@3 Marks Each)

This document is a student's computer science worksheet that contains questions and a programming assignment. The questions ask about Python's history, print functions, and syntax errors. The programming assignment asks the student to create a Python program that takes a user's name, class, section, and marks in 9 subjects. It should calculate the total, average percentage, and grade the student based on their percentage ranging from fail to excellent. It also tests for percentage values below 0 or above 100 which would return an error.

Uploaded by

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

A. Read The Following Questions and Write Your Answer On The File Document Given (@3 Marks Each)

This document is a student's computer science worksheet that contains questions and a programming assignment. The questions ask about Python's history, print functions, and syntax errors. The programming assignment asks the student to create a Python program that takes a user's name, class, section, and marks in 9 subjects. It should calculate the total, average percentage, and grade the student based on their percentage ranging from fail to excellent. It also tests for percentage values below 0 or above 100 which would return an error.

Uploaded by

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

NAME: DATE:

GRADE & SECTION: SCORE:

SUBJECT: Computer Science Parent’s Signature Teacher’s Signature


CHAPTER: Python
Semester 2 Worksheet 4

A. Read the following questions and write your answer on the file document given (@3 marks
each).
1. What is Python? Who invented it? And when?
2. To display a text message, what function do we use?
3. Invalid syntax detected on the program below. Why?
a=input("Enter any random number:")
if a==5:
print("The number is 5")
elif a>5:
print("The number you've entered is bigger than the target")
elif a<5:
print("The number is smaller than the target")
4. What is the difference between int() and float() in python?
5. Johnny is trying to make this code running, but he is unable to do so. Why? And give the
correct code!

signal=INPUT "Enter the signal color:"


if signal=red:
print("Stop")
else if signal="Yellow":
print=("Wait")
else:
print==Go

Sem 2 W4 || Page 1
B. Practical
You are to create a program in Python. Copy and paste the code in the evidence
document and submit through ManageBac!
1. Create a program where a user is able to insert the following:
• Name, [1]
• Class, [1]
• Section, [1]
• English mark, [1]
• Computer Science mark, [1]
• Mathematics mark, [1]
• Economic mark, [1]
• Bahasa Indonesia mark, [1]
• Accounting mark and [1]
• Mandarin mark. [1]
• Find the total mark [1]
• And find their average. [1]
• The program should check for the following conditions:
▪ If the percentage falls below 45, they are considered fail. [1]
▪ If the percentage is between 45 and 60, grade them as pass. [1]
▪ If the percentage is between 60 and 75, good. [1]
▪ If the percentage is between 75 and 85, very good. [1]
▪ If the percentage is between 85 and 100, excellent. [1]
▪ If the percentage is below zero or above 100, it’s an error. [1]

Sem 2 W4 || Page 2

You might also like