66158 – Student Number: (enter on the line below)Student Name:

SOLUTION AT Australian Expert Writers

Student Number: (enter on the line below)Student Name: (enter on the line below)HS1031INTRODUCTION TO PROGRAMMINGFINAL ASSESSMENTTRIMESTER 1, 2021Assessment Weight: 40 total marksInstructions:• All questions must be answered by using the answer boxes provided in this paper.• Completed answers must be submitted to Blackboard by the published due date and time.Submission instructions are at the end of this paper.Purpose:This assessment consists of six (6) questions and is designed to assess your level of knowledge of the key topics covered in this unitQuestion 1 ( 6 marks)Multiple Choice QuestionsPlease write the letter of the correct answer in the third column of the table below (i.e. a, b, c, or d).Question Answer123456Total1. Which of the following lists of operators is ordered by increasing precedence?a. +, *, **b. *, /, %c. **, *, +d. %,/,*2. When the function range receives three arguments, what does the third argument specify?a. the last value of a sequence of integersb. the last value of a sequence of integers plus 1c. the last value of a sequence of integers minus 1d. the increment amount of the sequence, be default plus 13. Consider the following code:How many time this program will run?a. At least Onceb. Twicec. It dependsd. Infinitely4. In a recursive function call, where does Python store the values of function’s arguments:a. Stringb. Dictionaryc. Stack framed. List5. After importing the math module, what function can be used to display its resources in Python IDLE?a. show(math)b. dir(math)c. print(math)d. display(math)6. Consider the following expression: -%3d- % num, which of the following statements is correct?a. num must be a float numberb. num must be an integerc. num must be a stringd. It does not matterQuestion 2 (6 marks)Case StudySandeep is a nascent Python developer. He has been asked by his manager to use functions in his code whenever possible. However, Sandeep feels that using functions is a waste of time. Provide three reasons to convince Sandeep to start using functions in his scripts.ANSWER: ** Answer box will enlarge as you typeQuestion 3 (6 marks)For each of the following code snippets, explain: (i) what does the code do? And (ii) What is the expected output?(1)(2)ANSWER:(1)(2)Question 4 (6 marks)Consider the following code snippet.Answer the following questions:(a) What do you think the purpose of this program is?(b) What does the statement in Line 4 do?(c) What does the code in Line 12 achieve?(d) What happens if the print statement in Line 16 is moved a tab forward (i.e. aligned with the if-else statement in lines 12 & 14)?ANSWER:(a)(b)(c)(d)Question 5 (8 marks)CountriesThe attached text file (countries.txt) includes a list of countries in a non-specific order. Furthermore, many of these countries are repeated in the file. You were asked by your company to produce a list of world’s.Write a Python code to retrieve data from the file and print out the unique names of countries a descending order. Your program should prompt the users to determine whether the list should be printed in ascending or descending order. Save your file as countries.py (make sure to include it in your submission).ANSWER:Python scriptQuestion 6 (8 marks)Python language provides various built-in functions which can be used by programs without worrying about the code. One of the most frequently used built-in functions in Python is the range function.Answer the following questions:(a) Explain what does the range function do.(b) The range function has three arguments: start, stop and step. Describe the function of each of these arguments.(c) Develop a function (name it uRange(start,stop,step)) which imitates Python’s range function. uRange take at least one argument (stop) and maximum of three.• If only one argument is passed to uRange, it is assumed to be the ‘stop’. Start takes zero, while step is equated to one.• If two arguments are passed to uRange, those would be ‘start’ and ‘stop’. Start takes zero, while step is equated to one. Step is equal to one by default.• If three arguments are passed to uRange, those would be ‘start’, ‘stop’ and ‘step’.Use None as a default value for the second and third parameters. So the first part of the function definition determines what the parameters are, whilst the rest of the code uses the values of these parameters to generate a sequence of numbers counting up or down (in the form of list).See below examples for the output:ANSWER:(a)(b)(c) Python scriptEND OF FINAL ASSESSMENTSubmission instructions:• Save your answers in the the answer boxes provided in this paper, including your Python code. Save your file with your STUDENT ID NUMBER and UNIT CODE e.g. EMV54897 HS1031• This file must be saved in MICROSOFT WORD FORMAT ONLY• For answers that involves Python script, make sure to also save your code in .py file format.• Place ALL your submission files (MS Word + Python files) in one folder (again, with your STUDENT ID NUMBER and UNIT CODE e.g. EMV54897 HS1031), and convert the folder into a ZIP file (RAR format is NOT acceptable)• Upload your submission to the appropriate link on Blackboard• Only one submission is accepted. Please ensure your submission is the correct document (this would be your ZIP file).• All submissions are automatically passed through SafeAssign to assess academic integrity.

Order from Australian Expert Writers
Best Australian Academic Writers

QUALITY: 100% ORIGINAL PAPERNO PLAGIARISM – CUSTOM PAPER

Assignment status: Already Solved By Our Experts

(USA, AUS, UK & CA Ph. D. Writers)

CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS

Order from Australian Expert Writers
Best Australian Academic Writers

QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER

YOU MAY ALSO READ ...  Cryptographic Algorithms - Swift Essay Assist