حل واجبات الجامعة العربية المفتوحة
اتصل : O544321455 - OO966544321455
واتس اب: 966544321455+
ايميل : a_al_shora@hot mail.com
سكايبي : a_al_shora
حل واجب 0.5.4.4.3.2.1.4.5.5 الجامعة العربية المفتوحة
حل واجبات الجامعة العربية المفتوحة O54.4.3.2.1.4.5.5 - OO96654.4.3.2.1.4.5.5
ايميل : a_al_shora @ h.o.t.m.ail.c.o.m
سكايبي: a_al_shora
واتس اب: OO96654.4.3.2.1.4.5.5
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.
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 type)
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]
(Add an Item into the Array - Button) [9 marks]
When the user clicks on the button, the text -field values for a certain type of item will be collected and an appropriate addItem method should be used from Equipment class according to the user selection for the type of item s/he wants to add.
An appropriate message should appear to inform the user that “the item is added successfully”.
Finally all text-fields should be cleared to be empty. Write a void method that makes the fields clear. [2 marks]
The value of ID text-Field should be checked first if its value is not a number, NumberFormatException exception should be invoked/handled if the value is not a number, and stop the processing of adding the item into the array. An appropriate message should appear to inform the user that "ID should be a number; the item won't be added into the array". Write a method that takes one argument which is the value of 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 Equipment reference object should be copied into a text file (assign the name of the file by yourself).
You have to use showEquipment()from Equipment class
An appropriate message should appear to inform the user either that “the items are copied successfully” into the file or “the Array is empty”.
Use try.. catch statement to handle IOException exception, and display a simple error message in case the process failed.
(Show all items in the Array- Button) [2 marks]
When the user clicks on the button, all the items in the Equipment reference object should be copied into a JTextArea in the second JPanel. An appropriate message should appear to inform the user that “The array is empty”.
(Exit- Button) [1 mark]
When the user clicks on the button, the program should terminate.
Part 3 [10 marks]
1- According to the Part 1 & 2 scenario, can we make Item class as an abstract class? Explain 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 the class Item implement the availableInterface interface? Explain your answer
3- Source:
“Object support for OpenMP-style programming of GPU clusters in Java” Carolin Wolf, Georg Dotzler, Ronald Veldema, Michael Philippsen
University of Erlangen-Nuremberg, Computer Science Department, Programming Systems 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 paper indicated above (note the dates), Read the paper carefully and answer ONLY 3 questions. The answers should be written in your own words.
Q1 Why do scientists use high level programming?
Q2. How does object orientation helpful?
Q3. What are the problems caused by placing objects in the memory? (List one)
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 OpenMPstyle?
“End of the Assignment”
حل واجبات الجامعة العربية المفتوحة
اتصل : O544321455 - OO966544321455
واتس اب: 966544321455+
ايميل : a_al_shora@hot mail.com
سكايبي : a_al_shora
حل واجب 0.5.4.4.3.2.1.4.5.5 الجامعة العربية المفتوحة
حل واجبات الجامعة العربية المفتوحة O54.4.3.2.1.4.5.5 - OO96654.4.3.2.1.4.5.5
ايميل : a_al_shora @ h.o.t.m.ail.c.o.m
سكايبي: a_al_shora
واتس اب: OO96654.4.3.2.1.4.5.5
اتصل : O544321455 - OO966544321455
واتس اب: 966544321455+
ايميل : a_al_shora@hot mail.com
سكايبي : a_al_shora
حل واجب 0.5.4.4.3.2.1.4.5.5 الجامعة العربية المفتوحة
حل واجبات الجامعة العربية المفتوحة O54.4.3.2.1.4.5.5 - OO96654.4.3.2.1.4.5.5
ايميل : a_al_shora @ h.o.t.m.ail.c.o.m
سكايبي: a_al_shora
واتس اب: OO96654.4.3.2.1.4.5.5
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.
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 type)
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]
(Add an Item into the Array - Button) [9 marks]
When the user clicks on the button, the text -field values for a certain type of item will be collected and an appropriate addItem method should be used from Equipment class according to the user selection for the type of item s/he wants to add.
An appropriate message should appear to inform the user that “the item is added successfully”.
Finally all text-fields should be cleared to be empty. Write a void method that makes the fields clear. [2 marks]
The value of ID text-Field should be checked first if its value is not a number, NumberFormatException exception should be invoked/handled if the value is not a number, and stop the processing of adding the item into the array. An appropriate message should appear to inform the user that "ID should be a number; the item won't be added into the array". Write a method that takes one argument which is the value of 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 Equipment reference object should be copied into a text file (assign the name of the file by yourself).
You have to use showEquipment()from Equipment class
An appropriate message should appear to inform the user either that “the items are copied successfully” into the file or “the Array is empty”.
Use try.. catch statement to handle IOException exception, and display a simple error message in case the process failed.
(Show all items in the Array- Button) [2 marks]
When the user clicks on the button, all the items in the Equipment reference object should be copied into a JTextArea in the second JPanel. An appropriate message should appear to inform the user that “The array is empty”.
(Exit- Button) [1 mark]
When the user clicks on the button, the program should terminate.
Part 3 [10 marks]
1- According to the Part 1 & 2 scenario, can we make Item class as an abstract class? Explain 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 the class Item implement the availableInterface interface? Explain your answer
3- Source:
“Object support for OpenMP-style programming of GPU clusters in Java” Carolin Wolf, Georg Dotzler, Ronald Veldema, Michael Philippsen
University of Erlangen-Nuremberg, Computer Science Department, Programming Systems 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 paper indicated above (note the dates), Read the paper carefully and answer ONLY 3 questions. The answers should be written in your own words.
Q1 Why do scientists use high level programming?
Q2. How does object orientation helpful?
Q3. What are the problems caused by placing objects in the memory? (List one)
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 OpenMPstyle?
“End of the Assignment”
حل واجبات الجامعة العربية المفتوحة
اتصل : O544321455 - OO966544321455
واتس اب: 966544321455+
ايميل : a_al_shora@hot mail.com
سكايبي : a_al_shora
حل واجب 0.5.4.4.3.2.1.4.5.5 الجامعة العربية المفتوحة
حل واجبات الجامعة العربية المفتوحة O54.4.3.2.1.4.5.5 - OO96654.4.3.2.1.4.5.5
ايميل : a_al_shora @ h.o.t.m.ail.c.o.m
سكايبي: a_al_shora
واتس اب: OO96654.4.3.2.1.4.5.5