aou
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


open unif
 
الرئيسيةأحدث الصورالتسجيلدخول

 

 حل واجبات -----0593565933-------------00966593565933

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



المساهمات : 13
تاريخ التسجيل : 04/11/2013

حل واجبات -----0593565933-------------00966593565933 Empty
مُساهمةموضوع: حل واجبات -----0593565933-------------00966593565933   حل واجبات -----0593565933-------------00966593565933 Emptyالثلاثاء نوفمبر 05, 2013 11:55 am

حل جميع واجبات الجامعة العربية المفتوحه
حل واجب M257----------------------M257




M257: Putting Java to Work
Fall 2013-2014
Assignment Booklet
Content: TMA M257 (Units 1-7) Cut-off date: Monday, December 9, 2013
This TMA assesses your work on Units 1-7 of M257. The marks allocated to each part of a question
are indicated in the margin. The total marks for each question are shown at the beginning of each
question.
For TMA questions that require coding, a number of marks may be awarded for the style of your Java
code. This means that we expect you to be consistent and to follow good practice in the naming of
identifiers and layout. When writing your code, add a comment at the top of each code page with
your own name as the author ONLY. In-line and end-line comments are strictly prohibited.
In all questions that require coding Part 1 & 2, you should do the following:
1- You should develop the required programs in NetBeans.
2- You must create ONE project for all TMA questions in one package, the default location for
NetBeans projects under Windows 7 is: Documents/NetBeansProjects.
This assignment should be submitted electronically:
• You should open a Text file
• You must add Your-ID, Your-Full-Name, Your-Session-Number in the first line of the
Text file,
• You must copy the source codes for Part 1 & 2 into a Text file, then
• You must add your answers for Part 3 at the end of the Text file
• then Save the text file
• Finally, copy all the contents of the text file and paste them into the text area on LMS,
that means you won’t upload the file, just copy and paste the contents of the Text file
Please note that there may be marks deduction if you don’t follow ALL of the above instructions.
M257 TMA Fall 13-14 Page 2
Part 1 [40 marks]
This assignment is an exercise in fundamental Java concepts such as: classes, constructors, methods,
composition, interfaces, basic control structure, and arrays. This question includes four sub- parts, each
of which is simple if done according to the specifications given in the exercise.
Write the following Java programs according to their specifications:
(a) Develop a public class Item to the following specifications: (10 marks)
• The class has two private instance variables: String name, and int id.
• The class has a one copy instance variable for all instance objects itemCounter, it
keeps the current number of items that have been created.
• The class has a two-argument constructor to set its instance variables to given
values.
• The class has a zero-argument constructor to initialize the values of its instance
variable. It should invoke the two-argument constructor.
• The class overrides the Object’s toString() method in order to return a string
representation of a item object similar to format given below:
Name= ,ID=
• The class implements any additional necessary methods, if applicable.
(b) Develop a public class SwItem to the following specifications: (8 marks)
• The class is a subclass of Item.
• The class has one private instance variable: String version.
• The class has a three-argument constructor to set its instance variables to given
values. This constructor should invoke the super-class constructor.
• The class has setter and getter methods for version.
• The class overrides the toString() method in order to return a string representation of a
SwItem object. It should invoke the parent’s toString()method to get the first part of the
returned value to be similar to format given below:
Sw Item {" Name= ,ID= ,Version= "}
(c) Develop a public class HwItem to the following specifications: (8 marks)
• The class is a subclass of Item.
• The class has one private instance variable: String type.
• The class has a three-argument constructor to set its instance variables to given
values. This constructor should invoke the super-class constructor.
• The class has setter and getter methods for type.
• The class overrides the toString() method in order to return a string representation of a
SwItem object. It should invoke the parent’s toString()method to get the first part of the
returned value to be similar to format given below:
Hw-Item {" Name= ,ID= ,Type= "}
(d) Develop a public class Equipment to the following specifications: (14 marks)
• The class has one private instance variable an array Item [ ], which will represent the
collection of items from class Item in the class Equipment.
M257 TMA Fall 13-14 Page 3
• The class has a zero-argument constructor that creates and initializes the array of
items and assigns its maximum size with any number you use greater than 100.
• The class has a public method void addGeneralItem(int aid, String aname) which is
used to create an instance object of Item and add it to the array of items.
• The class has a public method void addSWItem(int aid, String aname, String aver)
which is used to create an instance object of SwItem and add it to the array of items.
• The class has a public method void addHWItem(int aid, String aname, String atype)
which is used to create an instance object of HwItem and add it to the array of items.
• The class has a public String showEquipment() which returns either a string
representation of the array of items and all its different types of items or a string
message that “The array is empty”.
• The add-Item methods will be used in the second part of this TMA.
Part 2 [50 marks]
This assignment is an exercise on using and building GUI interfaces, writing event driven programs,
along with using flow control structures, and JOptionPane, Exception classes
Develop a public class MyFrameMain to the following specifications:
• You are required to build a GUI interface to be able to input the values of the instance
variables for the different types of items, add them to the array, copy the Array into a file,
and exit the program.
• The GUI interface should appear as in figure 1 below, it contains: [22 marks] total
1. A declaration and creation of a reference variable of the type Equipment [1 marks]
2. Set its size to 500x500.
3. Set its title to your AOU-ID and your name.
4. A JLabel for the ID and a JTextField to input its value.
5. A JLabel for the name a JTextField to input its value.
6. A JButtonGroup that contains three JRadioButton/s for SW, HW, and General. The
aim of using a JButtonGroup object is to tell Java that a set of buttons are grouped
together and have the property that only one of the buttons can be selected at a
time. Set General as an initial state selected.
7. A JTextField to input the value SW version.
8. A JTextField to input the value HW type.
9. A JLabel for the itemCounter value, which updates when new item is added
successfully to the array of items.
10. The JTextArea which uses to display the items of the array of items, and it is not
editable.
11. The class has 4 JButton/s according to their detailed specifications below. [16
marks] total
12. An appropriate event listener should be used and the buttons should implement the
listener object. [4 marks]
13. Appropriate resources should be checked and appropriate decisions should be
implemented
14. The class should have a main method to instantiate the class. [2 marks]
M257 TMA Fall 13-14
(Add an Item into the Array
• When the user clicks on the button, the text
collected and an appropriate
according to the user selection for the type of item s/he wants to add.
• An appropriate message should
successfully”.
• Finally all text-fields should be cleared to be empty.
fields clear. [2 marks]
• The value of ID text-Field should be checked first if
NumberFormatException
number, and stop the processing of adding the item into the array. An appropriate
message should appear to inform the user
be added into the array"
the id field and returns true if it is a number or false if not.
(Copy Array Into File- Button)
• When the user clicks on the button, all the items in
be copied into a text fil
• You have to use showEquipment()
• An appropriate message should appear to inform the user
copied successfully” into the file
• Use try.. catch statement to handle
error message in case the
(Show all items in the Array
• When the user clicks on the button, all the items in
should be copied into a
should appear to inform the user
(Exit- Button) [1 mark]
• When the user clicks on the
JFrame Attribute
- Title
- Border Layout
- 3 JPanels
Message: Array is
empty
- Button) [9 marks]
text-field values for a certain type of item will be
addItem method should be used from
appear to inform the user that “the item is added
Write a void method that makes th
its value is not a
exception should be invoked/handled if the value is not a
that "ID should be a number;
array". Write a method that takes one argument which is the value of
[4 marks]
[4 marks]
Equipment reference object
file (assign the name of the file by yourself).
from Equipment class.
either that
or “the Array is empty”.
IOException exception, and display a simple
process failed.
Array- Button) [2 marks]
the Equipment
JTextArea in the second JPanel. An appropriate message
that “The array is empty”.
button, the program should terminate.
Figure 1
Page 4
Equipment class
the
number,
the item won't
should
“the items are
, reference object
Second JPanel
Contains JTextArea
Third JPanel
Contains 4 buttons
M257 TMA Fall 13-14
Part 3 [10 marks]
1- According to the Part 1 & 2 scenario, can we make
your answer. [2 marks]
2- Consider the following Interface
public Interface availableInterface{
public boolean isAvailable();
public String availableStatus(); }
According to the Part 1 & 2 scenario, can
interface? Explain your answer
3- Source:
“Object support for OpenMP
Carolin Wolf, Georg Dotzler, Ronald Veldema, Michael Philippsen
University of Erlangen-Nuremberg,
Group, Erlangen, Germany, 27th International Conference on Advanced Information
Networking and Applications Workshops (WAINA 2013), 2013
Using the AOU’s eLibrary facility and the internet, locate the
dates), Read the paper carefully
written in your own words. [6
Q1 Why do scientists use high level programming?
Q2. How does object orientation helpful?
Q3. What are the problems caused by placing o
Q4. Why do we use the Java programming language?
Q5. What does CKM stand for and what is it responsible for?
Q6. What is the proposed solution?
Q7. What are JaMP and OpenMPstyl
Item class as an abstract class? Explain
the class Item implement the availableInterface
? answer. [2 marks]
OpenMP-style programming of GPU clusters in Java
Computer Science Department, Programming Systems
paper indicated
and answer ONLY 3 questions. The answers should be
marks]
objects in the memory? (List one
OpenMPstyle?
“End of the Assignment”
Page 5
Java”
above (note the
. bjects one)
الرجوع الى أعلى الصفحة اذهب الى الأسفل
https://aou1.banouta.net
 
حل واجبات -----0593565933-------------00966593565933
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» حل واجبات -----0593565933-------------00966593565933
» حل واجبات m131-----0593565933-------------00966593565933
» االتميز في حل الواجبات---- حل واجبات -----0593565933-------------00966593565933
» حل واجب ---m130 -----0593565933-------------00966593565933
» حل واجب ---T175B -----0593565933-------------00966593565933

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
aou :: الفئة الأولى :: المنتدى الأول-
انتقل الى: