المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : m150b مهندس احمد tma حل الواجب 0544321455 - 00966544321455 - [email protected]



أسواق
28-03-2013, 02:40 PM
M150 Data, computing and information

Question 1 [20 marks]
1. Write program according to the following: [20]
a. Define a function called findMax which takes an array argument and returns the maximum number in the array.
b. Define two arrays of numbers:
• The first array is initialized on declaration. It has 5 elements of your choice.
• The second array has 6 elements and is initialized by values entered by the user (in a loop). Enter the values of your choice.
c. Call the function findMax to find the maximum number is the two arrays. Print the returned numbers in the output You need also to print the elements of both arrays.
d. Provide a screenshot of the output of your program. Make sure that the output includes the elements of both arrays and the maximum number in each one.

Question 2 [20 marks]
In unit9, page 21 you were introduced to the methods associated with Date . In the same unit, section 4.2 you learned how to use functions from the "dateLibrary.js" in programs. The specifications for all the functions in this library are in Appendix 1 at the end of unit 9.
Write statements to do the following:
a. Create the date 7 June 2000 and assign it to the variable date1.
b. Create the date 18 May 2020 and assign it to the variable date2.
c. Calculate the difference in days and years between date1 and date2 and print them in the output
d. Change the month of date1 to be September and print the new value in the output
e. Change the year of date2 to be 2013 and print the new value in the output
f. Display the day of date1.
g. Display date1 in short form.
h. Insert a snapshot that shows the resulted output of parts d, e, f and g.
i. Provide a copy of the specifications of all the functions you’ve used in writing your program.
j. What information do we find in function specifications?

Question 3 [20 marks]
You are required to model a new user-defined type, site.
The site type has the following properties:
: a string variable representing the of the site.
url: a string variable representing the address of the site.
deion: a string variable holding a brief deion of the site.
The site type has the following methods:
get(): returns the of the site.
getUrl(): returns the url of the site.
getDeion(): returns the deion of the site.
display(): displays the , url and deion of the site in an alert The method should use the methods get(),getUrl() and getDeion().


a. Write the site constructor function site(a,aUrl,aDeion).
b. Implement the methods get(), getUrl(),
getDeion()and display() according to the above specifications.
c. Prompt the user for values of , URL and deion of a site he wants to create.
d. Create a site instance and initialize its properties by the values entered by the user.
e. Use an appropriate method to print the site instance information.
f. Run your program and test it to make sure it works properly. In your Solution insert two screenshots: [3]
• one showing the program prompting for the site , with you having entered the but not yet pressed OK;
• one showing the resulted alert
g. Change the deion of the site instance.
h. Suggest another way to change the deion of the site 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. Discuss four features of a good site. [4 marks]
2. Many computer users think that the user interface through which they communicate with the computer is the system. What are the impacts of having a poor UI system in an organization? [3 marks]
3. The course book has given you the definition for the term usability. Illustrate it using your own words and understanding. [4 marks]
4. Login to the SIS using your user and password. Write a short paragraph discussing the usability of the SIS, in your point of view. Do you think it is usable? Why? Why not? How can we improve it? Give suggestions. [9 marks]