CS30,ABDULLAH

This
work is important to me. Solve it correctly, without mistakes, without

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

plagiarism. Follow the instructions. There is no chance to repeat it.

Therefore, you must do a complete and correct work 100%.If you are sure you can do it, accept it put the solve in the cover College of Computing and Informatics
Assignment #2
Deadline: Day 26/11/2023 @ 23:59
[Total Mark for this Assignment is 8]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
• You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
• It is your responsibility to check and make sure that you have uploaded both the correct files.
• Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets, convert text into image or languages other than English
or any kind of manipulation).
• Email submission will not be accepted.
• You are advised to make your work clear and well-presented. This includes filling your information on the
cover page.
• You must use this template, failing which will result in zero mark.
• You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
• Late submission will result in ZERO mark.
• The work should be your own, copying from students or other resources will result in ZERO mark.
• Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s):
Question One
3 Marks
Create a java program that do the following:
Develop a
program based on
1- Create an array for a class of 10 students ID (arrStudents1)
specification
2- User inserts students IDs numbers in the array
using
3- Print out all the elements of the (arrStudents1)
programming
4- Create a new array (arrStudents2) and copy all student IDs from the first
language
elements
including syntax,
array in a reverse order.
5- Using enhanced for loop print all elements from (arrStudents2) on the
screen.
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes
1
Question Two
Pg. 02
Learning
Outcome(s):
3 Marks
Question Two
Write a class for the products in retail store with the following requirements.
Develop a
program based on
specification
using
programming
language
1. Each product class should have a name, an ID, a description, and a
price.
2. The product ID should be incremented automatically in the constructor
each time an object is created.
3. Create at least 4 different constructors for the class.
elements
including syntax,
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes
2
Question Three
Pg. 03
2 Marks
Learning
Outcome(s):
Question Three
Recognize the
(i) Identify the issue in following code and (ii) correct it.
concept of objectoriented
programming and
class Student {
int stuID;
String fName;
double gpa;
creating classes
Student(int stuID, String fName, double gpa) {
stuID = stuID;
fName = fName;
gpa = gpa;
}
void display() {
System.out.println(stuID + ” ” + fName + ” ” + gpa);
}
}
class StudentTest {
public static void main(String args[]) {
Student student1 = new Student(200200100, “Khalid”, 3.5);
Student student2 = aStudent(200200200, “Abdulaziz”, 3.7);
Student student3 = new Student(200200300, “Mohammed”, 2.4);
student1.display();
student2.display();
student3.display();
}
}
3

Still stressed with your coursework?
Get quality coursework help from an expert!