You are on page 1of 5

FACULTY OF INFORMATION TECHNOLOGY

PROGRAMMING 511 ASSIGNMENT

Name & Surname: _ ICAS / ITS No:

Qualification: Semester: Module Name:

Date Submitted:

ASSESSMENT CRITERIA MARK EXAMINER MODERATOR


ALLOCATION MARKS MARKS

MARKS FOR CONTENT


QUESTION ONE 30
QUESTION TWO 30
QUESTION THREE 30
TOTAL 90
MARKS FOR TECHNICAL ASPECTS
TABLE OF CONTENTS 2
Accurate numbering according to the numbering
in text and page numbers.
CODE 5
Program text indentation
Use of constant, variable and structure names
Comments
REFERENCES 3
According to the Harvard Method
TOTAL 10
TOTAL MARKS FOR ASSIGNMENT 100
Examiner’s Comments:

Moderator’s Comments:

Signature of Examiner: Signature of Moderator:


Assignment Instructions

1. All assignment 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 reflect in both in-text citations as well as the reference list or bibliography
4. In-text citations and a reference list or bibliography must be provided. Use the Harvard Style for
both in-text citations and the reference list or bibliography
5. Assignments submitted without citations and accompanying reference lists will be penalized.
6. Students are not allowed to share assignments with fellow students. Any shared assignments will
attract stiff penalties.
7. The use of, and copying of 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 properly labelled 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 on
Moodle. E.g. StudentNumber_CourseCode_Assignment (402999999_WBT512A_Assignment).
11. For each question in the assignment, paste the screenshot of the output. Below this
screenshot, paste all the code for that particular question.
QUESTION 1 (30 MARKS)

1.1 Write a program that takes user input for two variables, x and y, and performs the
following operations on them:

Assign x the value of 5 and print its value.


Assign y the value of 2 and print its value.
Add x and y together and store the result in a new variable z.
Print the value of z.
Subtract y from x and store the result in a new variable a.
Print the value of a.
Divide x by y and store the result in a new variable b.
Print the value of b.
Take the modulus of x and y and store the result in a new variable c.
Print the value of c.
Increment the value of x by 1.
Print the value of x.
Decrement the value of y by 1.
Print the value of y.
Constraints
 Use only the basic arithmetic operators (+, -, *, /, %, +=, and -=).
 Use only integer values for x and y.
 The program should be interactive and ask the user for the values of x and y.
(30)
QUESTION 2 (30 MARKS)

2.1 Draw a flowchart for the program that will ask the user to enter the amount of a
purchase. The program will then compute the state and county sales tax. Assume the
state sales tax is 5 percent and the county sales tax is 2.5 percent. The program will
then display the amount of the purchase, the state sales tax, the county sales tax, the
total sales tax, and the total of the sale (which is the sum of the amount of purchase
plus the total sales tax). (20)

2.2 Write a Python function to check whether a string is pangram or not. (Assume the
string passed in does not have any punctuation)

Note : Pangrams are words or sentences containing every letter of the alphabet at
least once.

For example : " The quick brown fox jumps over the lazy dog " (10)
QUESTION 3 (30 MARKS)

3.1 A software company sells a package that retails for $99. Quantity discounts are
given according to the following table:

Write a program that asks the user to enter the number of packages purchased. The
program should then display the amount of the discount (if any) and the total amount
of the purchase after the discount. (15)

3.2 Using nested loops, write a Python program that produces the following output:

(15)

3.3 Write a program that asks the user to enter five test scores. The program should
display a letter grade for each score and the average test score as follows:

END OF ASSIGNMENT

You might also like