حلول واجبات الجامعة العربية المفتوحة (لعــspring2015ـــام)

حلول واجبات الجامعة العربية المفتوحة لجميع تخصصات الجامعة ولجميع فروع الجامعة حلول واجبات – مشاريع تخرج – ملخصات هامة Mobile: 00966542495275 حلول واجبات الجامعة ا
 
الرئيسيةاليوميةس .و .جبحـثالأعضاءالمجموعاتالتسجيلدخول

شاطر | 
 

 Page 1 / 5 M150B TMA – Spring 2014/2015 Cut-off date: 25 & 26 April, 2015 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 ques

استعرض الموضوع السابق استعرض الموضوع التالي اذهب الى الأسفل 
كاتب الموضوعرسالة
whatsapp::00966542495275
Admin


عدد المساهمات : 1343
تاريخ التسجيل : 07/10/2014

مُساهمةموضوع: Page 1 / 5 M150B TMA – Spring 2014/2015 Cut-off date: 25 & 26 April, 2015 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 ques   الجمعة مارس 27, 2015 7:51 pm

Page 1 / 5
M150B
TMA – Spring 2014/2015
Cut-off date: 25 & 26 April, 2015
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).
The TMA is marked out of 80, out of which 20% will be considered for the continuous
assessment grade.
It consists of 3 questions; 25 marks allocated for each question plus 5 marks for the
programming style.
Important note:
− 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 [25 marks]
Write JavaScript program according to the following:
a. Define a JavaScript function countOddNumbers(anArray). The function
should calculate and return the number of odd numbers in the array anArray.
b. Define another JavaScript function countEvenNumbers(anArray). The
function should calculate and return the number of even numbers in the array
anArray.
c. Create an array of five elements.
d. Read numbers from the user and store them in the array. Print the elements in
the output window.
e. Use the two functions countOddNumbers and countEvenNumbers to
print the number of odd and even numbers in the array you defined.
f. Run your program to make sure it works as specified. Provide three screenshots
that show the output of your program in three different cases as follows:
- One when the array containing odd and even numbers.
- One when the array containing only odd numbers.
- One when the array containing only even numbers.
Page 3 / 5
Question 2 [25 marks]
In unit 9, you learnt that it is possible to use a function from its specification, without
needing to know how it works. You also learnt how to import a function library into a
JavaScript program and how to write simple programs that use a function library.
The course book introduces three functions libraries: "dateLibrary", "drawingLibarary"
and "stringLibrary". You can get the complete code and specification of these libraries
from the course CD.
Using functions from both: the "drawingLibarary.js" and the "stringLibrary.js", write
JavaScript program to do the following:
a. Draw a simple house using a triangle, a rectangle. Then draw three horizontal lines
under the house representing the grass.
b. Read a short sentence (not just a word) from the user describing the house. Print the
sentence in the output window.
c. Print the sentence reversed in the output window.
d. Read a single character from the user.
e. Check if the character is contained in the sentence you read from the user.
- If yes, then find out how many times the character exists in the sentence and
print the value in the output window.
- If no, print an appropriate message accordingly.
f. Print two different shapes of your choice.
g. Run your program to test it. In your Solution document insert two screenshots:
- One showing the case when the character is not contained in the sentence;
- One showing the case when the character is contained in the sentence.
Note: Steps a, c, e and f should be done using functions either from "drawingLibarary.js"
or "stringLibrary.js".
Page 4 / 5
Question 3 [25 marks]
You are required to model a new user-defined object type, Course. The Course
object type has the following properties:
name: a string representing the name of the course.
code: a string representing the code of the course.
gcc: a string representing the name of the General Course Coordinator of the course
(i.e. the name of the tutor responsible for putting the course exams and TMA).
finalDate: a Date object representing the date of the final exam of the course.
The Course object type has the following methods:
getName(): a method that returns the name of the course.
getCode(): a method that returns the code of the course.
getGCC(): a method that returns the name of the gcc of the course.
setGCC(aName): a method that changes the course gcc to aName.
calculateDaysLeft(): a method that calculates and returns the number of days
left for the final exam.
Write JavaScript statements to do the following:
a. Write the Course constructor function function Course (courseName,
courseCode, gccName,aDate).
b. Implement the methods getName(), getCode(), getGCC(), setGCC()and
calculateDaysLeft()according to the above specifications.
c. Create a Course object and initialize all its properties by values entered by the
user. This should include reading the values for the year, month and day of the final
exam date and create a Date object accordingly.
d. Use appropriate methods to do the following for the Course object you've created:
1. Print the name, code and the name of the gcc in the output window.
2. Print the date of the final exam. This should be done using function from
the Date library for clear representation of the date, such as
dateStringShort() or dateStringLong().
3. Print the numbers of days left for the final exam.
4. Change the name of the gcc to any name of your choice.
e. Without using any method, print the name of the new gcc in the output window.
f. In your Solution document insert two screenshots: [4]
- One showing the program prompting for the Course name, with you
having entered the name but not yet pressed OK;
- One showing all the resulted output of the program.
Page 5 / 5
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 short comments at the beginning of each program stating the purpose of your
program.
• Using spacing and indentation to help making the structure of your program clear.
• Making sure that the programs output include descriptive texts that clearly 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)
- Avoid very short identifiers, such as a, b, x, ch, because they are not
very informative.
- Avoid the use of $ and _ in identifiers.
- Choose meaningful names, i.e. names which give some indication of
the role played by the variable.
- Start your identifiers with lower-case letters. Where an identifier is
composed of two or more English words use a single upper-case
letter to mark the start of each word after the first.
TMA submission:
In addition to submitting a word file including the solution of the TMA questions, you
need to submit the source code of all the programs required for the three questions of
the TMA in separate files (.html). Put all your four files in one folder, compress it and
send it through the LMS.
Your TMA will not be marked if all the required files are not submitted.
Good Luck

_________________
الإجــابة النمــوذجية
----------------------

[عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا] || الكاتب: [عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا] || المصدر: [عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا]






خدمات مجانية – حلول واجبات الجامعة العربية المفتوحة
لجميع تخصصات الجامعة ولجميع فروع الجامعة
حلول واجبات – مشاريع تخرج – ملخصات هامة
http://learn.123.st/
Mobile: 00966544321455  or 0544321455
Watsapp: 00966544321455

a_al_shora@hotmail.com
حلول مضمونة وغير مكررة وغير متشابهة لجميع واجبات الجامعة
متوفرمدرسين ومدرسات لجميع المواد والتخصصات
KSA-Kuwait-Bahrain-Oman-Jordon-Lebanon-Egypt
الرجوع الى أعلى الصفحة اذهب الى الأسفل
معاينة صفحة البيانات الشخصي للعضو http://learn.123.st متصل
 
Page 1 / 5 M150B TMA – Spring 2014/2015 Cut-off date: 25 & 26 April, 2015 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 ques
استعرض الموضوع السابق استعرض الموضوع التالي الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» هدية من مستر محمد حسانين how to write paragraph
» Avira Premium Security Suite 9.0.0.387 + key 2014
» نكت 2015 لحق حالك
» شرح : كيفيه تغير الصفحه الرئيسيه للمتصفح home page
» How to feel confident on your first date

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
حلول واجبات الجامعة العربية المفتوحة (لعــspring2015ـــام) :: حل واجب الجامعة العربية المفتوحة 2015 الفصـــ 1 ــل :: حل واجبات ادارة الاعمال-
انتقل الى: