100%(1)1 out of 1 people found this document helpful
This preview shows page 1 - 4 out of 7 pages.
COS10009/COS60006 Test 2 - 2020 S1 REDOAssessment Details•Assessment: Test 2 – Sem 1 2020 V4 REDO•Unit Codes: COS10009 / COS60006•Duration: 2 hours in total. 90 minutes to complete, 30 minutes to submit.Student Name:Student ID: Instructions to CandidatesYou must complete all the questions.You must submit this test booklet to Doubtfire within 2 hours of the test becoming available.The test answers must be your own work. By submitting your answers to Doubtfire you are declaring the work as your own.Page 1 of 7
BASIC PASS SECTIONQ1. Answer the following questions:a) Write code using a whileloopin the Ruby programming language that will print out the 13 times table. Your output should look as follows:Write your Ruby code here:Page 2 of 7
b) Write a Ruby function that takes a character argument called argand returnstrueif the character’s ASCII decimal value is between 65 and 122 (inclusive) and falseotherwise.Use the Ruby function call arg.ord()to obtain the decimal value of theASCII character.c)