aou حل واجبات الجامعه العربيه المفتوحه2017/2018
الرئيسيةالرئيسية  اليوميةاليومية  س .و .جس .و .ج  بحـثبحـث  الأعضاءالأعضاء  المجموعاتالمجموعات  التسجيلالتسجيل  دخول  

شاطر | 

 M150 Data, computing and information

اذهب الى الأسفل 
كاتب الموضوعرسالة

المساهمات : 130
تاريخ التسجيل : 22/08/2016

مُساهمةموضوع: M150 Data, computing and information   السبت نوفمبر 25, 2017 10:36 pm

TMA – Fall 2017/2018
Cut-off date: To be announced
Total marks: 80

This TMA should be submitted to your tutor electronically through the LMS system before the cut-off date indicated above.
The TMA is marked out of 80, out of which 20% will be considered for your continuous assessment grade.
It consists of 2 questions: 35 marks for question1, 40 marks for question2 and 5 marks for the programming style.
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 to get high grade in this TMA.

Arab Open University Faculty of Computer Studies M150 Data, computing and information

Page 2 / 4

Question 1 [35 marks]

In this question you need to use functions from the "dateLibrary.js" in addition to some of the Date object methods you've learnt in unit 9. The specifications of all the functions in the "dateLibrary.js" library are in Appendix 1 at the end of unit 9.

1. Write a function called myLeapYearFunction(aDate) that takes a Date object as its argument. The function checks if aDate falls in a leap year and displays an appropriate message in the output window accordingly. The function should use the function isLeapYear() from the "dateLibrary.js".
2. Now, you need to do the following: a. Create any date in the year 2000 and print it in the long form (i.e. including the month name). b. Calculate the difference in days and years between today's date and the date you've just created and print them in the output window. Do the following to the date you've created in a.: c. Change the year to be 2018 and print the date again in the long form. d. Call the function myLeapYearFunction() to check whether it falls in a leap year. 3. Insert a screenshot that shows the resulted output of your code.
Page 3 / 4

Question 2 [40 marks]

You are required to model a new user-defined object type, Worker.
The Worker object type has the following properties:
name: a string representing the name of the worker.
hourlyWage: a number representing the hourly wage of the worker in dollars.
hours: a number representing the total number of working hours worked by the worker.
The Worker object type has the following methods:
getName(): a method that returns the name of the worker.
getHourlyWage(): a method that returns the hourlyWage of the worker.
getHours():a method that returns the hours worked by of the worker.
calculatePayment():a method that calculates the total payment of the worker. This is calculated by multiplying the hours worked by the hourly wage of the worker. For example, if a worker worked for 40 hours and his hourly wage is 35$, then his payment will be 40 X 35 which is 1400$.
printDetails(): a method that displays (in an alert window) the name, hourly wage, hours worked and total payment of the worker. The method should use the available methods of the Worker object.
a. Write the Worker constructor function function Worker (aName, anHourlyWage, numberOfHours).
b. Implement all the Worker methods according to the above specifications.
c. Prompt the user for values of name, hourly wage and total number of hours worked by the Worker object to be created.
d. Create a Worker object and initialize its properties by the values entered by the user. e. Print the Worker object information using the printDetails() method. f. Run your program. In your Solution document insert two screenshots: [4]
− one showing the program prompting for the Worker name, with you having entered your name but not yet pressed OK;
− one showing the resulted alert window. g. Change the hourlyWage of the Worker instance. You need first to read the new value of hourly wage from the user.
h. Print the Worker instance information again and provide another screenshot showing the resulted alert window.

Page 4 / 4

Programming style [5 marks]:

In your answers to questions 1, 2 and 3, you should follow good programming style that helps readability. This includes:

• Using comments at the beginning of each program stating the purpose of it. • Using spacing and indentation to help making the structure of your program clear. • The output of programs includes descriptive texts that describe the resulted output. • Following the M150 style guidelines when choosing the names of the variables. This includes: (Refer to section 2.2 of unit 7, page 16) - Avoiding very short identifiers, such as a, b, x, ch. - Avoiding the use of $ and _ in identifiers. - Choosing meaningful names that give indication of the role played by the variable. - Starting your identifiers with lower-case letters.

TMA submission:

You should write your solutions to all the questions with the required screenshots in a single word document. Head the document with your name and your student ID.

End of question

الرجوع الى أعلى الصفحة اذهب الى الأسفل
معاينة صفحة البيانات الشخصي للعضو http://wagbat-123.a7larab.net
M150 Data, computing and information
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
» ربط قاعدة البيانات بأستخدام الأداة data في vb6
» المكانز
» مقارنة سريعة بين الميكروبروسيسور والميكروكنترولر والplc
» الطريقة الوحيدة لايجاد كود البوك لاتصالات المغرب و مديتيل
» اعضاء الكلام Organs of Speech (فى الصوتيات)

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
wagbat.123 :: حل واجبات الجامعه العربيه المفتوحه whats.app: 00966542495275 :: حلول واجبات 2017/2018 AOU(يشاهدة الآن 3537 زائر)-
انتقل الى: