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

Management Question

Description I only need the solution to questions 6 and 7. ‫المملكة العربية السعودية‬ ‫وزارة التعليم‬ ‫الجامعة السعودية اإللكترونية‬ Kingdom of Saudi Arabia Ministry of Education Saudi Electronic University College of Administrative and Financial Sciences Assignment 3 Decision Making and Problem Solving (MGT 312) Due Date: End of week 13,

Web Design IT404

Description Web Design IT404 Students Details: CRN: ### Name: ### Name: ###Name: ### Name: ### ID: ### 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 FOLDER. THESE FILES

CT Module 13: Project Management

Description CT Module 13: Project Management n this module, you will learn about the behavioral aspects of project management as well as components of the work breakdown structure. Projects are unique undertakings that must support the organization’s strategic plan. Pay attention to the connection between the strategic goals of an

Week3—Mgt402

Description No Plagiarism , No Matching will be acceptable .clear and presented using APA Style Reference . ✨Add 6 references✨ All answers must be typed using Times New Roman ( Size12 , Double-space)font . No pictures containing text will be acceptable and will be considered plagiarism. proper examples and explanations

Week3—MGT401

Description Mgt401 No Plagiarism , No Matching will be acceptable .clear and presented using APA Style Reference . ✨Add 6 references✨ All answers must be typed using Times New Roman ( Size12 , Double-space)font . No pictures containing text will be acceptable and will be considered plagiarism. proper examples and

MGT404–S3

Description No Plagiarism , No Matching will be acceptable .clear and presented using APA Style Reference . ✨Add 6 references✨ All answers must be typed using Times New Roman ( Size12 , Double-space)font . No pictures containing text will be acceptable and will be considered plagiarism. proper examples and explanations

Management Question

Description ‫المملكة العربية السعودية‬ ‫وزارة التعليم‬ ‫الجامعة السعودية اإللكترونية‬ Kingdom of Saudi Arabia Ministry of Education Saudi Electronic University College of Administrative and Financial Sciences Assignment 3 Management of Technology (MGT 325) Due Date: 6/12/2025 @ 23:59 Course Name: Management of Technology Student’s Name: Course Code: MGT 325 Student’s ID

Management Question

Description ‫المملكة العربية السعودية‬ ‫وزارة التعليم‬ ‫الجامعة السعودية اإللكترونية‬ Kingdom of Saudi Arabia Ministry of Education Saudi Electronic University College of Administrative and Financial Sciences Assignment 3 Strategic Management (MGT 401) Due Date: 06/12/2025 @ 23:59 Course Name: Strategic Management Student’s Name: Course Code: MGT 401 Student’s ID Number: Semester:

project cyber

Description Answer the attached project make sure you meet all the requierment. Artifical intellegance work is not accepted which will result to ZERO if detected by BB or professor. i honestly want an A+ otherwise i would not pass. College of Computing and Informatics Project Deadline: Wednesday 03/12/2025 @23:59 [Total

MGT424 Quality Management

Description Instructions to access the case study: • Using Six Sigma DMAIC to improve the quality of theproduction process: a case study, Monika Smętkowska, Beata Mrugalska*Instructions to read the case study’ Access the link below to download directly the case study PDF: Or Through SDL Using Six Sigma DMAIC to

MGT-401: Strategic Management

Description 1-please plagiarism not acceptable2-references are required3-number of words as required 4- CLO3-PLO2.2- Explain the contribution of functional, business, and corporate strategies to the competitive advantage of the organization. CLO4-PLO2.3-Distinguish between different types and levels of strategy and strategy implementation. CLO6-PLO3.1-Communicate issues, results, and recommendations coherently and effectively regarding appropriate

MGT-402: Entrepreneurship and small bus

Description 1-please plagiarism not acceptable2-references are required3-number of words as required 4-Learning Outcomes: 1. Describe the place of small business in history and explore the strengths and weaknesses of small business. 2. Design a solid projected financial plan and conduct a breakeven analysis for a small company. 3. Demonstrate the

MGT-404: Organization Design and develo

Description Note: You must include at least 5 references. Format your references using APA style. 1-please plagiarism not acceptable2-references are required3-number of words as required 4-Learning Outcomes: Describe the basic steps of the organizational development process. Evaluate the strategic role of change in the organization and its impact on organizational

MGT-424: Quality management

Description 1-please plagiarism not acceptable2-references are required3-number of words as required The Assignment`s learning Outcomes: Using Six Sigma DMAIC to improve the quality of The production process: a case study , Monika Smętkowska, Beata Mrugalska*Instructions to read the case study’ In the 3rd assignment, the students are required to read

MGT321: Intro to International Business

Description Students are advised to make their work clear and well-presented. Poor presentation may result in reduced marks. This includes filling in your information on the cover page. Students must mention the question number clearly in their answers. Late submissions will NOT be accepted. Avoid plagiarism. Your work should be

MGT521-M5C3-Critical Thinking: Engaging the Organization in the Change Process

Description I need help completing a discussion board post for my Management course (Managing Dynamic Environment). Below are the exact requirements provided by my instructor: Description: This module offers several fundamental lessons that can determine an organization’s and an employee’s success, beginning with the notion and practice of ethics. Ethics

MGT-322: Logistics Managements

Description Students are advised to make their work clear and well-presented. Poor presentation may result in reduced marks. This includes filling in your information on the cover page. Students must mention the question number clearly in their answers. Late submissions will NOT be accepted. Avoid plagiarism. Your work should be

ACCT-301: Cost Accounting

Description Students are advised to make their work clear and well-presented. Poor presentation may result in reduced marks. This includes filling in your information on the cover page. Students must mention the question number clearly in their answers. Late submissions will NOT be accepted. Avoid plagiarism. Your work should be