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

PROGRAMING 511 Assignment

Programming assistant assignment questions

Uploaded by

The Richman
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)
18 views

PROGRAMING 511 Assignment

Programming assistant assignment questions

Uploaded by

The Richman
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/ 3

FACULTY OF INFORMATION TECHNOLOGY

PROGRAMMING 511
ST
1 SEMESTER ASSIGNMENT

Name & Surname: ITS No:

Qualification: Semester: Module Name:

Date Submitted:

ASSESSMENT CRITERIA MARK EXAMINER MODERATOR


ALLOCATION MARKS MARKS
MARKS FOR CONTENT
QUESTION ONE 20
QUESTION TWO 20
QUESTION THREE 50
TOTAL 90
MARKS FOR TECHNICAL ASPECTS
CODE LAYOUT/STRUCTURE AND 10
COMMENTS
TOTAL MARKS FOR ASSIGNMENT 100
Examiner's Comments:

Moderator's Comments:

Signature of Examiner: Signature of Moderator:


ASSIGNMENT INSTRUCTIONS

1. All assignments must be typed, not handwritten.


2. Every assignment should include the cover page, table of contents and a reference list or
bibliography at the end of the document.
3. A minimum of five current sources (references) should be used in all assignments, and these should
be reflected in both in-text citations and the reference list or bibliography.
4. In-text citations and a reference list or bibliography must be provided. Use the Harvard Style for in-
text citations and the reference list or bibliography.
5. Assignments submitted without citations and accompanying reference lists will be penalised.
6. Students are not allowed to share assignments with fellow students. Any shared assignments will
attract stiff penalties.
7. Using and copying content from websites such as chegg.com, studocu.com, transtutors.com,
sparknotes.com or any other assignment-assistance websites is strictly prohibited. This also applies
to Wiki sites, blogs, and YouTube.
8. Any pictures and diagrams used in the Assignment should be labelled appropriately and referenced.
9. Correct formatting as indicated on the Cover Page should be followed (font size 12, font style Calibri,
line spacing of 1.0 and margins justified)
10. All assignments must be saved in PDF using the correct naming convention before uploading them
to Moodle: E.g., StudentNumber_CourseCode_Assignment (402999999_WBT512A_Assignment).
QUESTION 1 (20 MARKS)

1.1 Explain the role and importance of comments in Python programming. How do comments enhance
code readability and maintainability? (5 Marks)

1.2 Discuss the concept of variables in Python, contrasting them with constants. Provide examples to
illustrate how variables are used differently from constants in a program. (5 Marks)

1.3 Detail the significance of different data types in Python. Provide examples of at least three data
types and scenarios where each is appropriately used. (5 Marks)

1.4 Outline the process of input, processing, and output in Python programs. Describe a real-world
scenario where this process is crucial, such as data entry and processing in a retail system. (5 Marks)

QUESTION 2 (20 MARKS)

2.1 Explain how Python handles arithmetic operations with an emphasis on operator precedence. Use
examples to illustrate how Python evaluates complex arithmetic expressions. (5 Marks)

2.2 Describe the use and functionality of escape characters in Python strings. Provide examples of
how escape characters can be used in formatting text output, such as in generating a formatted
report. (5 Marks)

2.3 Discuss the concept of string concatenation and formatting in Python with examples. Explain how
these concepts can be applied in generating user-friendly messages or data output. (5 Marks)

2.4 Define named constants in Python and explain their purpose. Illustrate with an example how using
named constants can make a program more readable and maintainable, such as in a scientific
calculation. (5 Marks)

QUESTION 3 (50 MARKS)

3.1 Develop a Python script to simulate a basic user authentication system using if-else statements
and logical operators. The script should prompt the user for a username and password and validate
them against predefined credentials. (20 Marks)

3.2 Write a Python program using a while loop to calculate and display the factorial of a user-input
number. Ensure your program handles invalid inputs gracefully. (15 Marks)

3.3 Design a Python script that uses a for loop to print a pattern of numbers or characters. For instance, create a
script that prints a pyramid pattern using asterisks (*) based on a user-input height. (15 Marks)

You might also like