Data, computing and information


Data, computing and information

Document Preview:

Page 1 /5 M150B TMA – Spring 2013/2014 Cut-off date: May 3rd and May 4th Total marks: 80 This TMA should be submitted to your tutor electronically through the LMS system before the cut-off date indicated above. You should write your solutions to the questions in a single word document. Head the document with your name and your Personal Identifier (ID). This TMA assesses your understanding of Units 8 (section 3), 9, 10 and 12 of M150B. It is marked out of 80, out of which 20% will be considered for the continuous assessment grade. It consists of 4 questions. The total marks for each question are shown at the beginning of each question. The marks allocated to each part of a question are indicated in the margin. Important notes: – Before you start working with this assignment, you need to refer to section 8.2 of the M150 course companion to read about plagiarism and how to avoid it. This will help you in getting high grade in this TMA. Arab Open University Faculty of Computer Studies M150 Data, computing and information
Page 2 /5 Question 1 [20 marks] 1. Write JavaScript program according to the following: a. Define a JavaScript function multiConcat, that takes a String and a number as arguments, and returns a String that is the argument string concatenated with itself n number of times (where n is the second argument). For example, if the arguments are ‘Salam’ and 4, the return value is ‘SalamSalamSalamSalam’. b. Define another JavaScript function reverse that takes a string as argument and returns the reverse of that word. For example, if the argument is ‘Salam’, the return value is ‘malaS’. c. Ask the user to enter a string and a positive number greater than 0. Assume the user enters a valid number. d. Print the values entered by the user in the output window. e. Use the function multiConcat to display the string concatenated with itself a number of times in the output window. f. Use the function reverse to display the reverse of the string returned from calling…

Attachments:


You can leave a response, or trackback from your own site.
error: Content is protected !!