Object Oriented Programming — COIT11134

 Instruction Sheet

  1. Write your answers clearly. Use numbered headings or subheadings to show which part of your answer refers to which question. Example: Part A – Question 2.
  • Write your answers from page 10 of this document. Please do not modify this document’s content from page 1 to 9.

Page 1 of 9

PART A                                                                                              10 MARKS

COMPULSORY QUESTIONS

Answer ALL questions from this part.

Each question is worth 2.0 marks (5 x 2 = 10 marks).

Briefly comment on the following statements from Java language point of view. For each question, limit your answers to three to four sentences only.

Question 1                                                                                                              2 Marks

Differentiate Instance variables from static variables.

Question 2                                                                                                              2 Marks

Java Interface can have instance fields and default method implementations.

 

Question 3                                                                                                              2 Marks

In Java, a sub class can implement only one interface and can be extended from multiple superclasses.

Question 4                                                                                                              2 Marks

How can you remove two adjacent elements from the collection that an Iterator is referring to?

Question 5                                                                                                              2 Marks

Java abstract class can contain implemented and abstract methods.

 

PART B                                                                                             35 MARKS

Answer all questions from this part.

Question 1                                                                                             3 Marks

The following class Loan has incomplete codes. Complete the missing lines of code for the given parameterized constructor, isToMonitor() method, and an overridden toString() method.

Hint:

If the loan amount exceeds $500,000 then isToMonitor() method has to return true; otherwise it should return false.

 

toString() method should display the Loan details and based on isToMonitor() method’s return value whether the Loan needs monitoring or not.

import java.time.*; public class Loan

{

private double loanAmount; private LocalDate startDate;

private double interestRate;

private static final double LIMIT = 500000.0;

/**@param givenLoanAmount the loan amount

  • @param year the year of startDate
  • @param month the month of startDate
  • @param day the day of startDate

*/

public Loan ( double givenLoanAmount, int year, int month, int day, double givenInterestRate)

{

//Missing lines of code need to be completed by the student

}

/* If the loan amount exceeds $500,000 then isToMonitor()

method has to return true; otherwise it should return false.*/

public boolean isToMonitor()

{

//Missing lines of code need to be completed by the student

}

/* toString() method should display the Loan details and based on isToMonitor() method’s return value whether the Loan needs monitoring or not. */

@Override

public String toString()

{

//Missing lines of code need to be completed by the student

}

}//end class definition

Question 2            3 Marks

How can you create a unique LoanId for each object of Loan (as mentioned in the above Question 1)? Modify the Loan class given in the above Question 1, and create new class named ModifiedLoan, so that each object of ModifiedLoan will have a unique LoanId.

Question 3            3 Marks

Write a driver class to test the ModifiedLoan class that you have created in Question-2).  The driver should do the following:

  1. create two ModifiedLoan objects; one with the loan amount less than $500000 and the other with the loan amount more than $500000.
  2. print the details of the ModifiedLoan objects on the screen.
Question 4                                                                                                              3 Marks

The following UML class diagram shows that GSTItem class is a subclass of Expense class.

The following table provides the characteristics of the fields that are used in the above two classes.

Field nameClassAccess specifierData type
NameExpenseprivateString
AmountExpenseprivatedouble
GSTIncludedExpenseprivateboolean
GSTAmountGSTItemprivatedouble

You need to write (define) the above mentioned two Java classes. Your classes should have appropriate fields/variables, constructors and overridden toString() methods.

Question 5                                                                                                              3 Marks

Write (define) an interface called as GSTApplicable. The GSTApplicable interface should have a constant and a method declared with the specification as mentioned in the following table:

Field/method nameDescription
percentageOfGSTA constant with the value of 10
calculateGSTA public method that receives no parameters and returns a double

 

Question 6                                                                                                              3 Marks

Modify the GSTItem class you have created as part of Question 4 to implement the interface GSTApplicable that you have created as part of Question 5.  The modified class should have the name “ModifiedGSTItem” and should include implementation of all the methods declared in the interface GSTApplicable.

 

Question 7                                                                                                              3 Marks

The following Java program uses the data structure Stack to store data and the program runs without any error. Write the output produced by the program run.

import java.util.Stack; public class StackTest

{

public static void main(String [] args)

{

// name of structures in an array

String [] buildingPlan = {“Foundation”, “Wall”,”Roof”, “Antenna”};

/*creating buildingStack and taking the contents from buildingPlan array and placing them into the buildingStack*/

Stack<String> buildingStack =new Stack<String>();

for(int i=0; i< buildingPlan.length; i++) buildingStack.push(buildingPlan [i]);

/* creating demolitionStack, taking some of the contents from the buildingStack, one by one, and place them in demolitionStack */

Stack <String> demolitionStack =new Stack <String>(); while(buildingStack.size()>1)

demolitionStack.push(buildingStack.pop());

//printing the name of structures System.out.print(“buildingStack contains “); while(buildingStack.size()>0)

System.out.println(buildingStack.pop());

System.out.println(“demolitionStack contains “);

while(demolitionStack.size()>0)

System.out.println(demolitionStack.pop());

} // end of main method

} // end of class

Question 8                                                                                           6 Marks

The following InsuranceClaim class is incomplete. You need to complete the missing lines of code in

  • toString() method
    • inner class – Approval
    • main method

The expected output is as follows:

Claim Amount: 4500.00 for Claim Id: 1001 has not been approved

Claim Amount: 4500.00 for Claim Id: 1002 has been approved

Note:

An insurance claim is approved only when the claim amount is not exceeding the insured amount.

public class InsuranceClaim {

    private double insuredAmount;

    private double claimAmount;

    private int claimId;

    boolean approved; // for approve or reject the claim by desk verification

    //constructor

    public InsuranceClaim(double insuredAmount, double claimAmount, int claimId) {

        this.insuredAmount = insuredAmount;

        this.claimAmount = claimAmount;

        this.claimId = claimId;

        new Approval().deskVerify();

    }

    @Override

    public String toString() {

        // Student needs to complete the missing lines of code

    }

    class Approval {

/*Complete the deskVerify() method given below. If the claim amount does not exceed the insured amount, it can be approved; otherwise, it is not approved.  To change the instance variable ‘approved’ accordingly.

*/

        void deskVerify(){

// Student needs to complete the missing lines of code

        }

    }

     public static void main (String [] args) {

/*Student needs to complete the missing lines of code

write code to create an InsuranceClaim object with parameters such that the output

 “Claim Amount: 4500.00 for Claim Id: 1001 has not been approved” is produced.

*/

   

          InsuranceClaim myCalim = new

   

       System.out.println(       

/* Student needs to complete the missing lines of code

write code to create an InsuranceClaim object with parameters such that the output

“Claim Amount: 4500.00 for Claim Id: 1002 has been approved” is produced.

*/

   

          InsuranceClaim yourCalim = new

   

          System.out.println(

    }

}

 

Question 9                                                                                                                4 Marks

The ShapeTest class contains incomplete code in the main method. You need to complete the missing lines of code to test the polymorphic behaviour by calling the calculateArea() method appropriately.

// an interface interface Shape {

public double calculateArea();

}

//Rectangle class

class Rectangle implements Shape {

// fields/variables double length; double width;

//constructor

public Rectangle(double length, double width) { setLength(length);

setWidth(width);

}

//getters and setters

public double getLength() { return length;

}

public void setLength(double length) { if(length > 0)

this.length = length;

}

public double getWidth() { return width;

}

public void setWidth(double width) { if(width > 0)

this.width = width;

}

// returning the area of rectangle public double calculateArea(){

return length * width;

}

}// end of Rectangle class

//Circle class

class Circle implements Shape {

// fields/variables double radius;

//constructor

public Circle(double radius) { setRadius(radius);

}

//getters and setters

public double getRadius() { return radius;

}

public void setRadius(double radius) {

if(radius > 0) this.radius = radius;

else

this.radius = 0.0;

}

// returning area of circle public double calculateArea()

{

return Math.PI * radius * radius;

}

}

// to test the objects of Rectangle and Circle public class ShapeTest {

public static void main(String [] args){ Shape [ ] diagrams = new Shape [2];

/* Store the references to one rectangle and one circle shape objects in the above-mentioned ‘diagrams’ array.

Loop through the ‘diagrams’ array and invoke the calculateArea() method of the two shape objects stored in the array to test the polymorphic behavior.

*/

//Missing lines of code need to be completed by the student

}

}

Question 10                                                                                         4 Marks

Write short notes on the following. Your answer should have maximum three sentences for each of the following:

  • Generic method
  • Generic class
  • raw type and upper bound

— End of Exam Questions —

Order Now
No Fields Found.
Universal Assignment (September 9, 2024) Object Oriented Programming — COIT11134. Retrieved from https://universalassignment.com/object-oriented-programming-coit11134/.
"Object Oriented Programming — COIT11134." Universal Assignment - September 9, 2024, https://universalassignment.com/object-oriented-programming-coit11134/
Universal Assignment July 3, 2022 Object Oriented Programming — COIT11134., viewed September 9, 2024,<https://universalassignment.com/object-oriented-programming-coit11134/>
Universal Assignment - Object Oriented Programming — COIT11134. [Internet]. [Accessed September 9, 2024]. Available from: https://universalassignment.com/object-oriented-programming-coit11134/
"Object Oriented Programming — COIT11134." Universal Assignment - Accessed September 9, 2024. https://universalassignment.com/object-oriented-programming-coit11134/
"Object Oriented Programming — COIT11134." Universal Assignment [Online]. Available: https://universalassignment.com/object-oriented-programming-coit11134/. [Accessed: September 9, 2024]

Please note along with our service, we will provide you with the following deliverables:

Please do not hesitate to put forward any queries regarding the service provision.

We look forward to having you on board with us.

Categories

Get 90%* Discount on Assignment Help

Most Frequent Questions & Answers

Universal Assignment Services is the best place to get help in your all kind of assignment help. We have 172+ experts available, who can help you to get HD+ grades. We also provide Free Plag report, Free Revisions,Best Price in the industry guaranteed.

We provide all kinds of assignmednt help, Report writing, Essay Writing, Dissertations, Thesis writing, Research Proposal, Research Report, Home work help, Question Answers help, Case studies, mathematical and Statistical tasks, Website development, Android application, Resume/CV writing, SOP(Statement of Purpose) Writing, Blog/Article, Poster making and so on.

We are available round the clock, 24X7, 365 days. You can appach us to our Whatsapp number +1 (613)778 8542 or email to info@universalassignment.com . We provide Free revision policy, if you need and revisions to be done on the task, we will do the same for you as soon as possible.

We provide services mainly to all major institutes and Universities in Australia, Canada, China, Malaysia, India, South Africa, New Zealand, Singapore, the United Arab Emirates, the United Kingdom, and the United States.

We provide lucrative discounts from 28% to 70% as per the wordcount, Technicality, Deadline and the number of your previous assignments done with us.

After your assignment request our team will check and update you the best suitable service for you alongwith the charges for the task. After confirmation and payment team will start the work and provide the task as per the deadline.

Yes, we will provide Plagirism free task and a free turnitin report along with the task without any extra cost.

No, if the main requirement is same, you don’t have to pay any additional amount. But it there is a additional requirement, then you have to pay the balance amount in order to get the revised solution.

The Fees are as minimum as $10 per page(1 page=250 words) and in case of a big task, we provide huge discounts.

We accept all the major Credit and Debit Cards for the payment. We do accept Paypal also.

Popular Assignments

FPC006 Taxation for Financial Planning

Assignment 2 Instructions Assignment marks: 95 | Referencing and presentation: 5 Total marks: 100 Total word limit: 3,000 words Weighting: 40% Download and use the Assignment 2 Answer Template provided in KapLearn to complete your assignment. Your assignment should be loaded into KapLearn by 11.30 pm AEST/AEDT on the wdue

Read More »

TCHR5001 Assessment Brief 1

TCHR5001 Assessment Brief 1 Assessment Details Item Assessment 1: Pitch your pedagogy Type Digital Presentation (Recorded) Due Monday, 16th September 2024, 11:59 pm AEST (start of Week 4) Group type Individual Length 10 minutes (equivalent to 1500 words) Weight 50% Gen AI use Permitted, restrictions apply Aligned ULOS ULO1, ULO2,

Read More »

HSH725 Assessment Task 2

turquoise By changing the Heading 3 above with the following teal, turquoise, orange or pink you can change the colour theme of your CloudFirst CloudDeakin template page. When this page is published the Heading 3 above will be removed, but it will still be here in edit mode if you wish to change the colour theme.

Read More »

Evidence in Health Assessment 2: Evidence Selection

Evidence in Health Assessment 2: Evidence Selection Student name:                                                                    Student ID: Section 1: PICO and search strategy Evidence Question: Insert evidence question from chosen scenario here including all key PICO terms.       PICO Search Terms                                                                                                                                                                                                          Complete the following table.   Subject headings Keywords Synonyms Population  

Read More »

Assessment 1 – Lesson Plan and annotation

ASSESSMENT TASK INFORMATION: XNB390 Assessment 1 – Lesson Plan and annotation This document provides you with information about the requirements for your assessment. Detailed instructions and resources are included for completing the task. The Criterion Reference Assessment (CRA) Marking Matrix that XNB390 markers will use to grade the assessment task

Read More »

XNB390 Task 1 – Professional Lesson Plan

XNB390 Template for Task 1 – Professional Lesson Plan CONTEXT FOR LESSON: SOCIAL JUSTICE CONSIDERATIONS: Equity Diversity Supportive Environment UNIT TITLE:    TERM WEEK DAY TIME 1   5           YEAR/CLASS STUDENT NUMBERS/CONTEXT LOCATION LESSON DURATION         28 Children (chl): 16 boys; 12

Read More »

A2 Critical Review Assignment

YouthSolutions Summary The summary should summarise the key points of the critical review. It should state the aims/purpose of the program and give an overview of the program or strategy you have chosen. This should be 200 words – included in the word count. Critical analysis and evaluation Your critical

Read More »

PUN364 – Workplace activity Assignment

Assessment 1 – DetailsOverviewFor those of you attending the on-campus workshop, you will prepare a report on the simulated simulated inspection below. For those of you who are not attending, you will be required to carry out your own food business inspection under the supervision of a suitably qualified Environmental

Read More »

FPC006 Taxation for Financial Planning

Assignment 1 Instructions Assignment marks: 95 | Referencing and presentation: 5 Total marks: 100 Total word limit: 3,600 words Weighting: 40% Download and use the Assignment 1 Answer Template provided in KapLearn to complete your assignment. Your assignment should be loaded into KapLearn by 11.30 pm AEST/AEDT on the due

Read More »

Mental health Nursing assignment

Due Aug 31 This is based on a Mental health Nursing assignment Used Microsoft word The family genogram is a useful tool for the assessment of individuals, couples, and families.  It can yield significant data and lead to important, new patient understandings and insights as multigenerational patterns take shape and

Read More »

Assessment 2: Research and Policy Review

Length: 2000 words +/- 10% (excluding references)For this assessment, you must choose eight sources (academic readings and policy documents) as the basis of your Research and Policy Review. You must choose your set of sources from the ‘REFERENCES MENU’ on the moodle site, noting the minimum number of sources required

Read More »

HSN702 – Lifespan Nutrition

Assessment Task: 2 Assignment title: Population Nutrition Report and Reflection Assignment task type: Written report, reflection, and short oral presentation Task details The primary focus of this assignment is on population nutrition. Nutritionists play an important role in promoting population health through optimal nutritional intake. You will be asked to

Read More »

Written Assessment 1: Case Study

Billy a 32-year-old male was admitted to the intensive care unit (ICU) with a suspected overdose of tricyclic antidepressants. He is obese (weight 160kg, height 172cm) and has a history of depression and chronic back pain for which he takes oxycodone. On admission to the emergency department, Paramedics were maintaining

Read More »

Assessment Task 8 – Plan and prepare to assess competence

Assessment Task 8 – Plan and prepare to assess competence Assessment Task 8 consists of the following sections: Section 1:      Short answer questions Section 2:      Analyse an assessment tool Section 3:      Determine reasonable adjustment and customisation of assessment process Section 4:      Develop an assessment plan Student Instructions To complete this

Read More »

Nutrition Reviews Assignment 2 – Part A and Part B

This assignment provides you with the opportunity to determine an important research question that is crucial to address based on your reading of one of the two systematic reviews below (Part A). You will then develop a research proposal outlining the study design and methodology needed to answer that question

Read More »

NUR332 – TASK 3 – WRITTEN ASSIGNMENT

NUR332 – TASK 3 – WRITTEN ASSIGNMENT for S2 2024. DESCRIPTION (For this Task 3, the word ‘Indigenous Australians’, refers to the Aboriginal and Torres Strait Islander Peoples of Australia) NUR332 Task 3 – Written Assignment – Due – WEEK 12 – via CANVAS on Wednesday, Midday (1200hrs) 16/10/2024. The

Read More »

NUR100 Task 3 – Case study

NUR100 Task 3 – Case study To identify a key child health issue and discuss this issue in the Australian context. You will demonstrate understanding of contemporary families in Australia. You will discuss the role of the family and reflect on how the family can influence the overall health outcomes

Read More »

NUR 100 Task 2 Health Promotion Poster

NUR 100 Task 2 Health Promotion Poster The weighting for this assessment is 40%. Task instructions You are not permitted to use generative AI tools in this task. Use of AI in this task constitutes student misconduct and is considered contract cheating. This assessment requires you to develop scholarship and

Read More »

BMS 291 Pathophysiology and Pharmacology CASE STUDY

BMS 291 Pathophysiology and Pharmacology CASE STUDY Assessment No: 1 Weighting: 40% Due date Part A: midnight Friday 2nd August 2024 Due date Part B: midnight Sunday 29th September 2024 General information In this assessment, you will develop your skills for analysing, integrating and presenting information for effective evidence-based communication.

Read More »

Assessment Task: Health service delivery

Assessment Task Health service delivery is inherently unpredictable. This unpredictability can arise from, for example, the assortment of patient presentations, environmental factors, changing technologies, shifts in health policy and changes in division leadership. It can also arise from changes in policy within an organisation and/or associated health services that impact

Read More »

LNDN08002 Business Cultures Resit Assessment

LNDN08002 Business Cultures Resit Assessment Briefing 2023–2024 (Resit for Term 1) Contents Before starting this resit, please: 1 Assessment Element 1: Individual Report 1 Case Report Marking Criteria. 3 Assessment Element 2: Continuing Personal Development (CPD) 4 Guidance for Assessment 2: Reflection and Reflective Practice. 5 Student Marking Criteria –

Read More »

Assessment Task 2 – NAPLAN Exercise

Assessment Task 2 (35%) – Evaluation and discussion of test items Assessment Task 2 (35%) – Evaluation and discussion of test items AITSL Standards: This assessmeAITSL Standards: This assessment provides the opportunity to develop evidence that demonstrates these Standards: 1.2        Understand how students learn 1.5        Differentiate teaching to meet with

Read More »

EBY014 Degree Tutor Group 2 Assignment

  Assignment Brief Module Degree Tutor Group 2 Module Code EBY014 Programme BA (Hons) Business and Management with   Foundation Year Academic Year 2024/2025 Issue Date 6th May 2024 Semester Component Magnitude Weighting Deadline Learning outcomes assessed 2 1 2000 words Capstone Assessment 100% 26th July, 2024 1/2/3/4 Module Curriculum

Read More »

NTW 600 Computer Network and Security

Assessment 2 Information and Rubric Subject Code  NTW 600 Subject Name Computer Network and Security Assessment Number and Title Assessment 2: Cyber Security Threats to IT Infrastructure of a real-world Organisation Assessment Type Group Assessment Length / Duration  1500 words Weighting %  30% Project Report: 20% Presentation :10% (Recorded) Total

Read More »

LAW500 Business Law Assessment 2 – Group Project

Assessment Information and Rubric Subject Code LAW500 Subject Name Business Law Assessment Number and Title Assessment 2 – Group Project Assessment Type Group Length / Duration 3000 words maximum, no ±10%, and excluding references Weighting % 30% Total Marks 100 Submission Online Submission via TurnitIn for the written report Due

Read More »

Population Nutrition Case Study Analysis

HSN702 – Lifespan Nutrition Assessment Task: 1 Assignment title: Population Nutrition Case Study Analysis Assignment task type: Short Written Report and Literature Search Strategy Task details The primary focus of this assignment is on population nutrition. Nutritionists play an important role in promoting population health through optimal nutritional intake. In

Read More »

Applied Quantitative Economics Assignment

Goldsmiths College, University of London Applied Quantitative Economics Project ** You must attempt only one project, and you must complete it either in R or in Excel ** General Background Key Stage 4 (KS4) is a legal term for the last two years of secondary school education in England leading

Read More »

Can't Find Your Assignment?

Open chat
1
Free Assistance
Universal Assignment
Hello 👋
How can we help you?