M150B 2015

اذهب الى الأسفل

M150B 2015

مُساهمة  whatsapp::00966542495275 في الجمعة أكتوبر 03, 2014 12:56 am

Page 1 / 4
TMA – Fall 2014/2015
Cut-off date: November 22nd and 23rd 2014
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
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 / 4
Question 1 [20 marks]
1. Write JavaScript program according to the following:
a. Define a JavaScript function biggerElements(anArray,
aValue). The function should calculate and display the number of array
elements greater than aValue. It then prints these elements.
b. Ask the user to enter the array size. Then, create an array accordingly.
c. Read numbers from the user and store them in the array. Print the
elements in the output window.
d. Ask the user to enter the value of the number you want to compare the
array elements with. Print the value in the output window. Find the
number of array elements bigger than that number using the function
e. Run your program to make sure it works as specified. Provide a
screenshot that shows the output of your program. Make sure that the
program output clearly shows the array elements, the number to
compare the elements with and the result of the function.
Question 2 [15 marks]
In unit9, page 21 you were introduced to the methods associated with Date object. In
the same unit, sections 3.2 and 4.2 you learned how to use functions from the
"drawingLibrary.js" and the "dateLibrary.js" in JavaScript programs. The specifications
for all the functions in these libraries are in section 3.2 and Appendix 1 of unit 9. You can
also get the JavaScript code of these libraries from the course CD.
Using functions from both the "drawingLibrary.js" and the "dateLibrary.js" and some
methods of the Date object type, write JavaScript program to do the following:
a. Draw two lines.
b. Create a Date object representing the date 13 September 2014 which
represents the study date of the current semester.
c. Create another Date object representing the date 25 December 2014 which
represents the end of the study of the current semester.
d. Calculate the difference in days between the two dates and print it in the output
e. Change the state of the Date object you've created in c to be 15 January 2015
which represents the last day of examination of the current semester. (You
should not create a new Date) Print the new date in the long form (i.e. 15
January 2015) in the output window.
f. Draw another two lines.
g. Insert a screenshot that shows the resulted output of your program. Make sure
that it includes
Page 3 / 4
Question 3 [25 marks]
You are required to model a new user-defined object type, Employee.
The Employee object type has the following properties:
name: a string representing the name of the employee.
dob: a Date object representing the date of birth of the employee.
salary: a number representing the salary of the employee.
The Employeeobject type has the following methods:
getName(): a method that returns the name of the employee.
getDOB(): a method that returns the dob of the employee.
getSalary():a method that returns the salary of the employee.
printDetails(): a method that displays (in an alert window) the name, date of birth, age
and salary of the employee. You need to use the available methods as needed. You need also to
use the two functions differenceInYears() and dateStringShort() from the
a. Write the Employee Card constructor function function Employee
(aName, aDOB, aSalary).
b. Implement the methods getName(), getDOB(), getSalary()and
printDetails() according to the above specifications.
c. Prompt the user for values of name , date of birth and salary of the
Employee object to created.
d. Create an Employee instance and initialize its properties by the values entered
by the user.
e. Print the Employee instance information using an appropriate method.
f. Run your program. In your Solution document insert two screenshots: [4]
− one showing the program prompting for the Employee name, with you
having entered your name but not yet pressed OK;
− one showing the resulted alert window.
g. Change the salary of the Employee instance you've created in d. You need
first to read the new salary from the user.
h. Print the Employee instance information to show the new change in salary.
i. Provide another screenshots showing the resulted alert window.
Page 4 / 4
j. Suggest another way to change the salary of the Employee instance other
than what you've done in g. Show the changes needed in the program to
implement it and give an example on how you are going to use it.
Question 4 [20 marks]
1. From your understanding, what is a User Interface (UI) and what are the
properties of a good UI? [4]
2. Discuss and explain the term "Consistency" as one of the UI design principles.
Give an example. [4 marks]
3. What advantage does consistency provide for users? [4 marks]
4. Consider Figure 1 below that shows part of the interface of Windows Media
Player. [8 marks]
a. Discuss and comment on the visibility and affordance of widget 1.
b. Discuss and comment on the visibility and affordance of widget 2.
Important note: In your answers to questions 1, 2 and 3, you should follow good
programming style that helps readability. This includes:
• Using short comment at the beginning stating the purpose of your program.
• Using spacing and indentations to help make the structure of your program
• Following the M150 style guidelines when choosing the names of the variables (
Refer to section 2.2 of unit 7 page 16)
• Programs output include descriptive texts that clearly describe the resulted
Figure 1

خدمات مجانية – حلول واجبات الجامعة - كل الجامعات
لجميع تخصصات الجامعة ولجميع فروع الجامعة
حلول واجبات – مشاريع تخرج – ملخصات هامة
whats.app : 00966542495275
حلول مضمونة وغير مكررة وغير متشابهة لجميع واجبات الجامعة
متوفرمدرسين ومدرسات لجميع المواد والتخصصات
قسم خاص لواجبات التربية لجميع التخصصات ولجميع المستويات


المساهمات : 1034
تاريخ التسجيل : 10/02/2012

معاينة صفحة البيانات الشخصي للعضو http://solve.123.st

الرجوع الى أعلى الصفحة اذهب الى الأسفل

الرجوع الى أعلى الصفحة

- مواضيع مماثلة

صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى