Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

Computer Science Question

Description

See

College of Computing and Informatics

Assignment 2
Deadline: Day 24/11/2024 @ 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):
Develop a
program based on
specification
using
programming
language
elements
including syntax,
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes.

Question One

3 Marks

1. Create a class named Person:
o Add the following instance variables:
▪ id (int): Stores a unique identifier for the person.
▪ name (String): Stores the name of the person.
▪ age (int): Stores the age of the person.
2. Implement the following methods in the Person class:
o setId(int id): Assigns a value to the id variable.
o setName(String name): Assigns a value to the name variable.
o setAge(int age): Assigns a value to the age variable.
o getId(): Returns the value of id.
o getName(): Returns the value of name.
o getAge(): Returns the value of age.
3. Write a test program to demonstrate the Person class:
o Create an instance of the Person class.
o Use the setId, setName, and setAge methods to assign values to the
instance.
o Use the getId, getName, and getAge methods to retrieve and print these
values.
4. Output Example:
Your program should produce output similar to the following: (use your real
information for the name and ID)

.

5. Screenshots Required:
o Include a screenshot of your code.
o Include a screenshot of the program output after running the test
program.

Question Two

Pg. 02
Learning
Outcome(s):
Develop a
program based on
specification
using
programming

Question Two
Write a Java program to find the largest element in an array.
1. Program Requirements:
o Prompt the user to input the size of the array.
o Allow the user to input the elements of the array.
o Find and display the largest element in the array.
2. Example Output:
Below is an example of how the program should run:

language
elements
including syntax,
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes.

3. Screenshots Required:
o Include a screenshot of your Java code.
o Include a screenshot of the execution output showing the
program in action.
o Use deferent numbers when running your program

3 Marks

Question Three

Pg. 03
Learning
Outcome(s):

Question Three
Consider the foillowing code:

Develop a
program based on
specification
using
programming
language
elements
including syntax,
data types,
conditional
statement, control
structures,
procedures,
arrays, objects
and classes.

public class OverloadExample {
public int multiply(int a, int b) {
return a * b;
}
public double multiply(double a, double b) {
return a * b;
}
public static void main(String[] args) {
OverloadExample example = new OverloadExample();
System.out.println(example.multiply(2, 3));
System.out.println(example.multiply(2.5, 3.5));
}
}
1. What happens if you try to call example.multiply(2, 3.5)?
2. Explain which method would be called and why.
3. What will be the output of the following line?
System.out.println(example.multiply(2, 3));
4. Explain why this output is produced.

2 Marks

Purchase answer to see full
attachment

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Project Data Structure CS240

Description Please only complete stages one and two; they are for me. Please do not use artificial intelligence or plagiarism, as the course instructor emphasizes these points. Please solve the project using only the material slides, without any external sources. College of Computing and Informatics Project Deadline: Tuesday 02/12/2025 @

Logistics Management (MGT 322)

Description College of Administrative and Financial Sciences Logistics Management ASSIGNMENT –3 Submission Date by students: 06/12/2025 Place of Submission:Students Grade Centre Weight:10 Marks Learning Outcome: 1. Demonstrate an understanding of how global competitive environments are changing supply chain management and logistics practice. 2. Apply essential elements of core logistic and

361 ASS 15

Description SEE College of Health Sciences Department of Public Health ASSIGNMENT COVER SHEET Course name: Fundamentals of Safety Course number: PHC 361 CRN: Paper Assignment Assignment title or task: (You can write a question) 1. What is the difference between Risk and Hazard? 2. What is the role of Promotion

An e-mail is sent to Party B, in order to form a contract

Description LAW-402: Law of E-Commerce LAW 402 Case Study Assignment Instructions Action Items An e-mail is sent to Party B, in order to form a contract. Party A is the sender of the email. Party A’s identification is located at the top of the e-mail and is sufficient to show

515 ct group

Description The Role of Human Rights in Global Health Ethics Your paper should meet the following structural requirements: Three to six pages in length, not including the cover sheet and reference page. Formatted according to APA 7th edition and Saudi Electronic University writing standards. Provide support for your statements with

MGT – 401 (Strategic Management)

Description Below are the conditions for completing the assignment. Additionally, there are further requirements inside the file that must be followed: -Make sure to avoid plagiarism as much as possible . -Use font Times New Roman , 12 font sizes. -Use 1.5 line spacing with adjust to all paragraphs (

Healthcare Leadership – Critical Literature Review

Description write like a family medicine resident in jeddah, Saudi Arabia with out mentioning that. The task you do: Write a 2,000-word critical review of the literature on leadership, culture, motivation and feedback and its application within your professional environment. In relation to the literature in healthcare leadership: 1- Critique

Discussion – Operation Management

Description – I want original text, no plagiarism. – You can find the instructions in the file. Please read it carefully. – APA Style Thanks – Textbook: Stevenson, W. (2021). Operations management (14th ed.). New York, NY: McGraw-Hill Irwin Textbook: Stevenson, W. (2021). Operations management (14th ed.). New York, NY:

Case study

Description Assignment Instructions Action Items Party A graduated from business school and has learned the details about running a successful business. He is ready to utilize his education and does not want to work for anyone. Party A had decided to sell the fifty thousand rulers that his Uncle gave

Cost Accounting /Acct301

Description Cost Accounting Student’s Name: Course Code: ACCT 301 Student’s ID Number: Semester: 1st Semester CRN:13932 Academic Year: 1447 H (2025-26) For Instructor’s Use only Instructor’s Name: Ahmed Alhadaithi Students’ Grade: /15 Level of Marks: High/Middle/Low Instructions – PLEASE READ THEM CAREFULLY • THE ASSIGNMENT MUST BE SUBMITTED ON BLACKBOARD

420 bader solve

Description The purpose of this assignment is to get the students familiar with a Corpus Tool (Sketch Engine) to analyze texts and reflect on its value in translation and linguistic research. Technical requirement: 1- Internet. 2- Microsoft Word (for writing the reflection). 3- Sketch Engine account (trial/student). As you practiced

Management Question

Description CAREFULLY • THE ASSIGNMENT MUST BE SUBMITTED ON BLACKBOARD (WORD FORMAT ONLY) VIA ALLOCATED FOLDER. • ASSIGNMENTS SUBMITTED THROUGH EMAIL WILL NOT BE ACCEPTED. • STUDENTS ARE ADVISED TO MAKE THEIR WORK CLEAR AND WELL PRESENTED, MARKS MAY BE REDUCED FOR POOR PRESENTATION. THIS INCLUDES FILLING YOUR INFORMATION ON

Decision Making and Problem Solving (MGT 312)

Description CAREFULLY • This assignment is a groupassignment.Each group will consist of 4-5 Students only. • THE ASSIGNMENT MUST BE SUBMITTED ONLY IN WORD FORMAT VIA ALLOCATED FOLDER. • ASSIGNMENTS SUBMITTED THROUGH EMAIL WILL NOT BE ACCEPTED. • STUDENTS ARE ADVISED TO MAKE THEIR WORK CLEAR AND WELL PRESENTED, MARKS

247 ass 8

Description see College of Health Sciences Department of Public Health ASSIGNMENT COVER SHEET Course name: Health Planning Course number: PHC 247 CRN Assignment title or task: In two essays answer the following questions: 1. Examples of Cultural Tailoring Throughout the Program Planning and Evaluation Cycle (5 grades) 2. What are

215 ASS 7

Description Describe the settings and communication channels. Describe the development process of messages.

Adjusting 244

Description see College of Computing and Informatics Project Deadline: Thursday 04/12/2025 @ 23:59 [Total Mark is 14] Student Details: CRN: Name: Name: Name: ID: ID: ID: Instructions: • You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on Blackboard via the allocated

Management Question

Description NO COPING ‫المملكة العربية السعودية‬ ‫وزارة التعليم‬ ‫الجامعة السعودية اإللكترونية‬ Kingdom of Saudi Arabia Ministry of Education Saudi Electronic University Department of Business Administration College of Administrative and Financial Sciences Assignment 3 Due Date: 6th Dec 2025 @ 23:59 Course Name: Project Management Student’s Name: Course Code: MGT 323

Management Question

Description General instructions for writing the final report: The report must be written in English language. The word limit is 3000-4000. If the report word count is not within the required word limit, marks will be deducted. Plagiarism or copying from other sources will result in ZERO marks. The font